Observable

Trait Observable 

Source
pub trait Observable<T> {
    // Required methods
    fn attach(&mut self, observer: Weak<Mutex<Box<dyn Observer<T> + Send>>>);
    fn detach(&mut self, observer: Weak<Mutex<Box<dyn Observer<T> + Send>>>);
}
Expand description

A Observable that can be observed by Observer.

T is the message being sent from the Observable to the Observer. This should be implemented using the ObserverList.

Required Methods§

Source

fn attach(&mut self, observer: Weak<Mutex<Box<dyn Observer<T> + Send>>>)

Attach a Observer to the Observable.

Should be implemented using ObserverList::attach.

Source

fn detach(&mut self, observer: Weak<Mutex<Box<dyn Observer<T> + Send>>>)

Detach a Observer to the Observable.

Should be implemented using ObserverList::detach.

Implementors§