pub struct Notify { /* private fields */ }Expand description
Notification primitive for efficient task coordination
Implementations§
Source§impl Notify
impl Notify
Sourcepub fn notified(&self) -> NotifyFuture<'_> ⓘ
pub fn notified(&self) -> NotifyFuture<'_> ⓘ
Wait for a notification
Sourcepub fn notify_one(&self)
pub fn notify_one(&self)
Notify one waiting task
The waker is taken under the state lock and woken after it is released:
Waker::wake may poll the task inline on this thread, and that poll
re-locks this state — waking under the lock would self-deadlock. Same
discipline as notify_waiters below and hybrid::notify.
Sourcepub fn notify_waiters(&self)
pub fn notify_waiters(&self)
Notify all waiting tasks.
Wakes every currently-registered waiter. This is independent of the
single-permit notify_one mechanism: a permit stored by a prior
notify_one (issued with no waiters present) is left intact, so a
subsequent notified() still observes 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