pub trait Wake: Send + Sync {
// Required method
fn wake(arc_self: &Arc<Self>);
}
Expand description
A way of waking up a specific task.
Any task executor must provide a way of signaling that a task it owns
is ready to be poll
ed again. Executors do so by implementing this trait.
Note that, rather than working directly with Wake
trait objects, this
library instead uses a custom Waker
to allow for
customization of memory management.
Required Methods§
Sourcefn wake(arc_self: &Arc<Self>)
fn wake(arc_self: &Arc<Self>)
Indicates that the associated task is ready to make progress and should
be poll
ed.
Executors generally maintain a queue of “ready” tasks; wake
should place
the associated task onto this queue.
§Panics
Implementations should avoid panicking, but clients should also be prepared for panics.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.