Skip to main content

Listenable

Trait Listenable 

Source
pub trait Listenable {
    // Required method
    fn add_listener(&self, listener: impl Fn() + 'static) -> Subscription;
}
Expand description

Something that can be listened to.

Required Methods§

Source

fn add_listener(&self, listener: impl Fn() + 'static) -> Subscription

Calls listener whenever this changes, until the returned Subscription is dropped.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§