pub struct Notification { /* private fields */ }Expand description
A simple concurrent notification object, based on absl::Notificiation from
the absl library. Notifications happen at most once (with future
notifications being no-ops). Waiting threads can block, optionally with a
timeout.
Implementations§
Source§impl Notification
 
impl Notification
pub fn wait_with_timeout(&self, timeout: Duration) -> bool
Sourcepub fn notify(&self)
 
pub fn notify(&self)
Notify all threads waiting on this notification, and unblock any future threads who may wait.
Sourcepub fn has_been_notified(&self) -> bool
 
pub fn has_been_notified(&self) -> bool
Query whether this notification has been notified, without blocking.
Trait Implementations§
Source§impl Default for Notification
 
impl Default for Notification
Auto Trait Implementations§
impl !Freeze for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnwindSafe for Notification
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