cooked_waker

Trait Wake

Source
pub trait Wake: WakeRef + Sized {
    // Provided method
    fn wake(self) { ... }
}
Expand description

Wakers that can wake by value. This is the primary means of waking a task.

This trait is implemented for most container types, like Box<T: Wake> and Option<T: Wake>. It is also implemented for shared pointer types like Arc<T> and &T, but those implementations call T::wake_by_ref, because they don’t have ownership of the underlying T.

Provided Methods§

Source

fn wake(self)

Wake up the task by value. By default, this simply calls WakeRef::wake_by_ref.

A Waker created by IntoWaker will call this method through Waker::wake.

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.

Implementations on Foreign Types§

Source§

impl Wake for Waker

Source§

fn wake(self)

Source§

impl<T: Wake> Wake for Option<T>

Source§

fn wake(self)

Source§

impl<T: Wake> Wake for Box<T>

Source§

fn wake(self)

Source§

impl<T: WakeRef + ?Sized> Wake for &T

Source§

impl<T: WakeRef + ?Sized> Wake for Rc<T>

Source§

fn wake(self)

Source§

impl<T: WakeRef + ?Sized> Wake for Weak<T>

Source§

impl<T: WakeRef + ?Sized> Wake for Arc<T>

Source§

impl<T: WakeRef + ?Sized> Wake for Weak<T>

Implementors§