Trait pharos::ObservableLocal[][src]

pub trait ObservableLocal<Event> where
    Event: Clone + 'static + Send
{ type Error: Error; fn observe_local(
        &mut self,
        options: ObserveConfig<Event>
    ) -> ObserveLocal<'_, Event, Self::Error>; }
Expand description

Like Observable, but the future returned is not Send, thus the observable type does not need to be Send.

Associated Types

The error type that is returned if observing is not possible.

Pharos implements Sink which has a close method, so observing will no longer be possible after close is called.

Other than that, you might want to have moments in your objects lifetime when you don’t want to take any more observers. Returning a result from observe enables that.

You can of course map the error of pharos to your own error type.

Required methods

Add an observer to the observable. Options allow chosing the channel type and to filter events with a predicate.

Implementors