pub struct NotifyOnce { /* private fields */ }
Expand description
Notify once allows waiter to register for certain conditions and unblocks waiter
when condition is signalled with notify
method.
The functionality is somewhat similar to a tokio watch channel with subscribe method, however it is much less error prone to use NotifyOnce rather then tokio watch.
Specifically with tokio watch you may miss notification, if you subscribe to it after the value was changed (Note that this is not a bug in tokio watch, but rather a mis-use of it).
NotifyOnce guarantees that wait() will return once notify() is called, regardless of whether wait() was called before or after notify().
Implementations§
Trait Implementations§
Source§impl Debug for NotifyOnce
impl Debug for NotifyOnce
Auto Trait Implementations§
impl !Freeze for NotifyOnce
impl !RefUnwindSafe for NotifyOnce
impl Send for NotifyOnce
impl Sync for NotifyOnce
impl Unpin for NotifyOnce
impl UnwindSafe for NotifyOnce
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