Observable

Trait Observable 

Source
pub trait Observable {
    type Event;

    // Required methods
    fn subscribe(&self, callback: fn(Self::Event)) -> Result<()>;
    fn unsubscribe(&self) -> Result<()>;
}
Expand description

Observable trait for objects that can emit events

Required Associated Types§

Source

type Event

Event type

Required Methods§

Source

fn subscribe(&self, callback: fn(Self::Event)) -> Result<()>

Subscribe to events

Source

fn unsubscribe(&self) -> Result<()>

Unsubscribe from events

Implementors§