pub trait AddListener<T> {
// Required method
fn add_listener(&self, f: T) -> Subscription;
}Expand description
An extension trait for AddListener::add_listener, which we want to
take a variety of function-like arguments for readability.
Required Methods§
Sourcefn add_listener(&self, f: T) -> Subscription
fn add_listener(&self, f: T) -> Subscription
Register a listener to this PubSub<_>, which will be automatically
deregistered when the return Subscription is dropped.
§Arguments
fThe callback, presumably a function-like type.