FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Observer

    struct · ferroui-reactive · v0.5.0

    struct Observer
    

    The factory of observers (Observer).

    View source

    Members

    create

    fn create<T: 'static>(on_next: impl Fn(T) -> () + 'static) -> Rc<dyn IObserver<T>>
    

    An observer of values; an error panics (Create(Action<T>)).

    Source

    create_with_error

    fn create_with_error<T: 'static>(on_next: impl Fn(T) -> () + 'static, on_error: impl Fn(ObservableError) -> () + 'static) -> Rc<dyn IObserver<T>>
    

    An observer of values and errors (Create(Action<T>, Action<Exception>)).

    Source

    create_with_completed

    fn create_with_completed<T: 'static>(on_next: impl Fn(T) -> () + 'static, on_completed: impl Fn() -> () + 'static) -> Rc<dyn IObserver<T>>
    

    An observer of values and the end; an error panics (Create(Action<T>, Action)).

    Source

    create_all

    fn create_all<T: 'static>(on_next: impl Fn(T) -> () + 'static, on_error: impl Fn(ObservableError) -> () + 'static, on_completed: impl Fn() -> () + 'static) -> Rc<dyn IObserver<T>>
    

    An observer of all three notifications (Create(Action<T>, Action<Exception>, Action)).

    Source

    to_observer

    fn to_observer<T: 'static>(handler: impl Fn(Notification<T>) -> () + 'static) -> Rc<dyn IObserver<T>>
    

    An observer that hands each notification, as a value, to handler (ToObserver(Action<Notification<T>>)).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.