pub struct WaitNotify { /* private fields */ }
Expand description
A WaitNotify waits for a notification to be sent.
§Examples
use wait_notify::WaitNotify;
use std::thread;
let wn = WaitNotify::default();
let wn_clone = wn.clone();
let handle = thread::spawn(move || {
// do some work
wn_clone.wait();
// do some work
});
// do some work
wn.notify();
// do some work
handle.join().unwrap();
Implementations§
Trait Implementations§
Source§impl Clone for WaitNotify
impl Clone for WaitNotify
Source§fn clone(&self) -> WaitNotify
fn clone(&self) -> WaitNotify
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for WaitNotify
impl RefUnwindSafe for WaitNotify
impl Send for WaitNotify
impl Sync for WaitNotify
impl Unpin for WaitNotify
impl UnwindSafe for WaitNotify
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