Trait orkhon::prelude::ops::nn::tract_data::internal::tract_smallvec::alloc::task::Wake [−][src]
wake_trait
)The implementation of waking a task on an executor.
This trait can be used to create a Waker
. An executor can define an
implementation of this trait, and use that to construct a Waker to pass
to the tasks that are executed on that executor.
This trait is a memory-safe and ergonomic alternative to constructing a
RawWaker
. It supports the common executor design in which the data used
to wake up a task is stored in an Arc
. Some executors (especially
those for embedded systems) cannot use this API, which is why RawWaker
exists as an alternative for those systems.
Required methods
pub fn wake(self: Arc<Self>)
[src]
wake_trait
)Wake this task.
Provided methods
pub fn wake_by_ref(self: &Arc<Self>)
[src]
wake_trait
)Wake this task without consuming the waker.
If an executor supports a cheaper way to wake without consuming the
waker, it should override this method. By default, it clones the
Arc
and calls wake
on the clone.