pub trait Listenable {
// Required method
fn add_listener(&self, listener: impl Fn() + 'static) -> Subscription;
}Expand description
Something that can be listened to.
Required Methods§
Sourcefn add_listener(&self, listener: impl Fn() + 'static) -> Subscription
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".