pub struct Notify { /* private fields */ }
Available on crate feature
alloc
only.Expand description
Synchronous notifier. This structure can be used not block threads until desired,
at which point all waiting threads can be awaken with notify_all
.
This structure drops loudly by default (a.k.a it will awake blocked threads when dropped),
but can be droped silently via silent_drop
Implementations§
Source§impl Notify
impl Notify
pub unsafe fn into_raw(self) -> *const ()
pub unsafe fn from_raw(ptr: *const ()) -> Self
pub fn listeners(&self) -> usize
pub fn notify_all(&self)
pub fn listen(&self) -> Listener
Sourcepub fn silent_drop(self)
pub fn silent_drop(self)
Drops the notifier without awaking blocked threads. This method may leak memory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Notify
impl RefUnwindSafe for Notify
impl Send for Notify
impl Sync for Notify
impl Unpin for Notify
impl UnwindSafe for Notify
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