Struct Waker
struct Waker { ... }
Waker allows cross-thread waking of Poll.
When created it will cause events with readable readiness and the
provided token if wake is called, possibly from another thread.
Notes
Waker events are only guaranteed to be delivered while the Waker value
is alive.
Only a single Waker can be active per Poll, if multiple threads need
access to the Waker it can be shared via for example an Arc. What
happens if multiple Wakers are registered with the same Poll is
unspecified.
Implementation notes
On platforms that support kqueue this will use the EVFILT_USER event
filter, see implementation notes of Poll to see what platforms support
kqueue. On Linux it uses eventfd.
Examples
Wake a Poll instance from another thread.
#
Implementations
impl Waker
fn new(registry: &Registry, token: Token) -> Result<Waker>Create a new
Waker.fn wake(self: &Self) -> Result<()>Wake up the
Pollassociated with thisWaker.
impl Debug for Waker
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Freeze for Waker
impl RefUnwindSafe for Waker
impl Send for Waker
impl Sync for Waker
impl Unpin for Waker
impl UnsafeUnpin for Waker
impl UnwindSafe for Waker
impl<T> Any for Waker
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Waker
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Waker
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for Waker
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for Waker
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Waker
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Waker
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>