pub struct ArcNotify { /* private fields */ }Expand description
Let background work wake the part of your program that needs its results. Only one caller should wait at a time. Store the results separately from the wake-up.
Implementations§
Source§impl ArcNotify
impl ArcNotify
pub fn new() -> Self
Sourcepub fn notify(&self)
pub fn notify(&self)
Wakes the waiting caller, or saves one wake-up for later if nobody is waiting. Repeated calls count as one until the wake-up is received, so this does not count work items.
Sourcepub fn notified(&self) -> NotifiedArc ⓘ
pub fn notified(&self) -> NotifiedArc ⓘ
Waits for a wake-up, including one saved before this call.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ArcNotify
impl Freeze for ArcNotify
impl RefUnwindSafe for ArcNotify
impl Send for ArcNotify
impl Sync for ArcNotify
impl Unpin for ArcNotify
impl UnsafeUnpin for ArcNotify
impl UnwindSafe for ArcNotify
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