pub struct MultiWaker { /* private fields */ }
Expand description
A utility type ensures that multiple pollers can all be waken up.
With tokio
’s design, poll_*
functions will only wake up the waker associated with the last poller.
This works well with tokio’s types, however due to OT-lib design issues, we might have multiple pollers
(e.g. Uart
’s API takes &self
instead of &mut self
). This utility ensures that even if multiple pollers
are present, no wake messages will be lost.
Implementations§
Source§impl MultiWaker
impl MultiWaker
Sourcepub fn register(&self) -> MultiWakerRegistration<'_>
pub fn register(&self) -> MultiWakerRegistration<'_>
Signal the intent to register a waker.
When registration eventually happens, it is treated as if the registration happens at this point in time. This is a cheap operation compared to the actual registration of the waker.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiWaker
impl RefUnwindSafe for MultiWaker
impl Send for MultiWaker
impl Sync for MultiWaker
impl Unpin for MultiWaker
impl UnwindSafe for MultiWaker
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