pub struct Notify { /* private fields */ }Expand description
A notification primitive commonly used to hand-wake another async task/structure — e.g. signaling “state changed, go re-check” without a full channel.
Implementations§
Source§impl Notify
impl Notify
Sourcepub fn notify_one(&self)
pub fn notify_one(&self)
Wake one waiting notified().await, or — if none is currently
waiting — store a permit so the next notified().await returns
immediately without waiting at all.
Sourcepub fn notify_waiters(&self)
pub fn notify_waiters(&self)
Wake every task currently waiting in notified().await. Does
not store a permit — a task that calls notified() after this
returns will wait for a future notification, not this one.
Sourcepub const fn notified(&self) -> Notified<'_>
pub const fn notified(&self) -> Notified<'_>
A future that resolves once this Notify is notified — either a
stored permit is consumed immediately, or a future
notify_one/notify_waiters
wakes it.
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 UnsafeUnpin 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