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