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§
Sourcefn wake(self)
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.