Skip to main content

Observable

Trait Observable 

Source
pub trait Observable: AsRef<Branch> {
    type Event;

    // Provided methods
    fn observe<F>(&self, f: F) -> Subscription
       where F: FnMut(&TransactionMut<'_>, &Self::Event) + 'static,
             Event: AsRef<Self::Event> { ... }
    fn observe_with<K, F>(&self, key: K, f: F)
       where K: Into<Origin>,
             F: FnMut(&TransactionMut<'_>, &Self::Event) + 'static,
             Event: AsRef<Self::Event> { ... }
    fn unobserve<K: Into<Origin>>(&self, key: K) -> bool { ... }
}

Required Associated Types§

Provided Methods§

Source

fn observe<F>(&self, f: F) -> Subscription
where F: FnMut(&TransactionMut<'_>, &Self::Event) + 'static, Event: AsRef<Self::Event>,

Source

fn observe_with<K, F>(&self, key: K, f: F)
where K: Into<Origin>, F: FnMut(&TransactionMut<'_>, &Self::Event) + 'static, Event: AsRef<Self::Event>,

Source

fn unobserve<K: Into<Origin>>(&self, key: K) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§