futures::prelude::task

Trait Wake

Source
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 polled 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§

Source

fn wake(arc_self: &Arc<Self>)

Indicates that the associated task is ready to make progress and should be polled.

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.

Implementors§