Skip to main content

NotifyLike

Trait NotifyLike 

Source
pub trait NotifyLike: Send + Sync {
    // Required methods
    fn notify_one(&self);
    fn notified(&self) -> impl Future<Output = ()> + Send + '_;
}
Expand description

Notification primitive. notify_one wakes one waiter; subsequent notified().await resumes when the next signal arrives.

Required Methods§

Source

fn notify_one(&self)

Wake one waiter, or store a pending notification if no waiter is currently parked.

Source

fn notified(&self) -> impl Future<Output = ()> + Send + '_

Park until the next notify_one signal arrives. Consumes one pending notification atomically with parking.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§