[−][src]Trait cooked_waker::IntoWaker
Objects that can be converted into an Waker
. This trait is
automatically implemented for any Wake + Clone + Send + Sync + 'static
type.
The implementation of this trait sets up a RawWakerVTable
for the type,
and arranges a conversion into a Waker
through the stowaway
crate,
which allows packing the bytes of any sized type into a pointer (boxing it
if it's too large to fit). This means that "large" waker structs will
simply be boxed, but wakers that contain a single Box
or Arc
field
(or any data smaller or the same size as a pointer) will simply move their
pointer directly. This Waker
will then call the relevant Wake
,
RefWake
, or Clone
methods throughout its lifecycle.
It should never be necessary to implement this trait manually.
Required methods
#[must_use]fn into_waker(self) -> Waker
Convert this object into a Waker
.