pub(crate) enum Handle {
CurrentThread(Arc<Handle>),
MultiThread(Arc<Handle>),
}
Variants§
Implementations§
source§impl Handle
impl Handle
pub(crate) fn current() -> Handle
pub(crate) fn blocking_spawner(&self) -> &Spawner
pub(crate) fn is_local(&self) -> bool
sourcepub(crate) fn can_spawn_local_on_local_runtime(&self) -> bool
pub(crate) fn can_spawn_local_on_local_runtime(&self) -> bool
Returns true if this is a local runtime and the runtime is owned by the current thread.
pub(crate) fn spawn<F>(&self, future: F, id: Id) -> JoinHandle<F::Output> ⓘ
sourcepub(crate) unsafe fn spawn_local<F>(
&self,
future: F,
id: Id,
) -> JoinHandle<F::Output> ⓘ
pub(crate) unsafe fn spawn_local<F>( &self, future: F, id: Id, ) -> JoinHandle<F::Output> ⓘ
Spawn a local task
§Safety
This should only be called in LocalRuntime
if the runtime has been verified to be owned
by the current thread.
pub(crate) fn shutdown(&self)
pub(crate) fn seed_generator(&self) -> &RngSeedGenerator
pub(crate) fn as_current_thread(&self) -> &Arc<Handle>
pub(crate) fn hooks(&self) -> &TaskHooks
source§impl Handle
impl Handle
pub(crate) fn num_workers(&self) -> usize
pub(crate) fn num_alive_tasks(&self) -> usize
pub(crate) fn injection_queue_depth(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Handle
impl !RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl !UnwindSafe for Handle
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)