AddListener

Trait AddListener 

Source
pub trait AddListener<T> {
    // Required method
    fn add_listener(&self, f: T) -> Subscription;
}

Required Methods§

Source

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
  • f The callback, presumably a function-like type.

Implementors§

Source§

impl<T, U> AddListener<U> for PubSub<T>
where T: Clone + 'static, U: Fn(T) + 'static,

Source§

impl<T, U> AddListener<U> for Subscriber<T>
where T: Clone + 'static, U: Fn(T) + 'static,

Source§

impl<T: Clone + 'static> AddListener<Callback<T>> for PubSub<T>