Skip to main content

Notify

Trait Notify 

Source
pub trait Notify<Value>: Send + Sync {
    // Required method
    fn notify(&self, value: Value);
}
Expand description

A synchronous destination for a notification value.

Called in ordinary thread context, never directly in a raw signal handler. Implementations should return promptly: enqueue work or wake a future rather than waiting for it to finish. Waiting remains specific to the destination.

Channel implementations enqueue without waiting for capacity. A closed receiver discards the value. Bounded senders have no default implementation: an application must choose its own overflow policy in a wrapper.

Required Methods§

Source

fn notify(&self, value: Value)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<Value, Target: Notify<Value> + ?Sized> Notify<Value> for Arc<Target>

Source§

fn notify(&self, value: Value)

Source§

impl<Value: Send> Notify<Value> for Sender<Value>

Source§

fn notify(&self, value: Value)

Implementors§

Source§

impl<Value> Notify<Value> for Cancellation