Skip to main content

Notifier

Trait Notifier 

Source
pub trait Notifier<T>: Send {
    // Required method
    fn notify(&mut self, data: T);
}
Expand description

Provides delegated notification of all strong references of a Primary being dropped.

See Primary::unwrap_with_notifier.

Required Methods§

Source

fn notify(&mut self, data: T)

Called when the data contained in the Primary reference can be extracted out because there are no more strong references to it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T> Notifier<T> for Infallible

A handy implementation for the common Infallible “Never” type.

Source§

fn notify(&mut self, _data: T)

Implementors§

Source§

impl<A, B, N: Notifier<B>, F: FnOnce(A) -> B> Notifier<A> for MapNotifier<N, F>
where Self: Send,

Source§

impl<T: Send> Notifier<T> for ArcNotifier<T>