Struct tokio::runtime::scheduler::multi_thread::handle::Handle

source ·
pub(crate) struct Handle {
    pub(super) shared: Shared,
    pub(crate) driver: Handle,
    pub(crate) blocking_spawner: Spawner,
    pub(crate) seed_generator: RngSeedGenerator,
    pub(crate) task_hooks: TaskHooks,
}
Expand description

Handle to the multi thread scheduler

Fields§

§shared: Shared

Task spawner

§driver: Handle

Resource driver handles

§blocking_spawner: Spawner

Blocking pool spawner

§seed_generator: RngSeedGenerator

Current random number generator seed

§task_hooks: TaskHooks

User-supplied hooks to invoke for things

Implementations§

source§

impl Handle

source

pub(crate) fn num_workers(&self) -> usize

source

pub(crate) fn num_alive_tasks(&self) -> usize

source

pub(crate) fn injection_queue_depth(&self) -> usize

source§

impl Handle

source

pub(crate) fn spawn<F>( me: &Arc<Self>, future: F, id: Id, ) -> JoinHandle<F::Output>
where F: Future + Send + 'static, F::Output: Send + 'static,

Spawns a future onto the thread pool

source

pub(crate) fn shutdown(&self)

source

pub(super) fn bind_new_task<T>( me: &Arc<Self>, future: T, id: Id, ) -> JoinHandle<T::Output>
where T: Future + Send + 'static, T::Output: Send + 'static,

source§

impl Handle

source

pub(super) fn trace_core(&self, core: Box<Core>) -> Box<Core>

source§

impl Handle

source

pub(super) fn schedule_task(&self, task: Notified<Arc<Handle>>, is_yield: bool)

source

pub(super) fn schedule_option_task_without_yield( &self, task: Option<Notified<Arc<Handle>>>, )

source

fn schedule_local( &self, core: &mut Core, task: Notified<Arc<Handle>>, is_yield: bool, )

source

fn next_remote_task(&self) -> Option<Notified<Arc<Handle>>>

source

fn push_remote_task(&self, task: Notified<Arc<Handle>>)

source

pub(super) fn close(&self)

source

fn notify_parked_local(&self)

source

fn notify_parked_remote(&self)

source

pub(super) fn notify_all(&self)

source

fn notify_if_work_pending(&self)

source

fn transition_worker_from_searching(&self)

source

fn shutdown_core(&self, core: Box<Core>)

Signals that a worker has observed the shutdown signal and has replaced its core back into its handle.

If all workers have reached this point, the final cleanup is performed.

source

fn ptr_eq(&self, other: &Handle) -> bool

Trait Implementations§

source§

impl Debug for Handle

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Lock<Synced> for &'a Handle

source§

type Handle = InjectGuard<'a>

source§

fn lock(self) -> Self::Handle

source§

impl Overflow<Arc<Handle>> for Handle

source§

fn push(&self, task: Notified<Arc<Handle>>)

source§

fn push_batch<I>(&self, iter: I)
where I: Iterator<Item = Notified<Arc<Handle>>>,

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.