Struct utils_atomics::notify::AsyncNotify
source · 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 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