Struct 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

pub(crate) fn worker_metrics(&self, worker: usize) -> &WorkerMetrics

Source§

impl Handle

Source

pub(crate) fn spawn<F>( me: &Arc<Self>, future: F, id: Id, spawned_at: SpawnLocation, ) -> 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, spawned_at: SpawnLocation, ) -> 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.