pub struct Waker { /* private fields */ }Expand description
Cloneable handle that interrupts an in-progress EventSource::poll or
EventSource::read.
A waker is bound to one source at construction time. Calling Waker::wake
makes the source’s readiness wait return Interrupted; multiple wake calls
may coalesce into one interruption. The handle is cheap to clone and can be
sent to other threads.
Implementations§
Source§impl Waker
impl Waker
Sourcepub fn wake(&self) -> Result<()>
pub fn wake(&self) -> Result<()>
Interrupt the EventSource this waker is bound to.
A blocked EventSource::poll returns Ok(false) and a blocked
EventSource::read returns an io::ErrorKind::Interrupted error.
The wake does not enqueue an Event and does not mutate decoder state.
Returns any platform error produced while signalling the wake handle.
Trait Implementations§
Auto Trait Implementations§
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
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more