pub struct Waker { /* private fields */ }Expand description
Wakes a driver blocked in Driver::turn from any thread. Cheap to clone; repeated wakes
before the driver runs collapse into one OS signal.
Implementations§
Source§impl Waker
impl Waker
Sourcepub fn wake(&self)
pub fn wake(&self)
Makes the driver’s current or next Driver::turn return Event::Wake.
Sourcepub fn post(&self)
pub fn post(&self)
Like Waker::wake, for work the caller has just queued for the driver’s thread (with
a sequentially consistent push, such as crate::mpsc::Mpsc::push): the current or next
Driver::turn returns Event::Wake, but the OS is signalled only when the driver is
parked in it. A driver that is running, or spinning in its busy poll, picks the work up
without a system call on either side, and posts that arrive together cost one signal.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Waker
impl !UnwindSafe for Waker
impl Forget for Waker
impl Freeze for Waker
impl Move for Waker
impl Send for Waker
impl Sync for Waker
impl Unpin for Waker
impl UnsafeUnpin 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