FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Notification

    enum · ferroui-reactive · v0.5.0

    enum Notification<T>
    

    A notification of an observable sequence as a value (Notification<T>).

    Two notifications are equal when they are of the same kind and their values are equal; errors compare by identity, as exceptions do upstream.

    View source

    Members

    OnNext

    OnNext(T)
    

    A value (Notification.CreateOnNext).

    Source

    OnError

    OnError(ferroui_system::ObservableError)
    

    An error (Notification.CreateOnError).

    Source

    OnCompleted

    OnCompleted
    

    The end of the sequence (Notification.CreateOnCompleted).

    Source

    kind

    fn kind(self: &Self) -> NotificationKind
    

    The kind of the notification (Kind).

    Source

    has_value

    fn has_value(self: &Self) -> bool
    

    Whether the notification has a value (HasValue).

    Source

    value

    fn value(self: &Self) -> Option<&T>
    

    The value of an OnNext notification (Value); None for the others, where upstream throws the error of an OnError and InvalidOperationException for OnCompleted.

    Source

    exception

    fn exception(self: &Self) -> Option<&ObservableError>
    

    The error of an OnError notification (Exception).

    Source

    accept

    fn accept(self: Self, observer: &dyn IObserver<T>)
    

    Delivers the notification to an observer (Accept(IObserver<T>)).

    Source

    accept_observer_with_result

    fn accept_observer_with_result<R>(self: Self, observer: &dyn IObserverWithResult<T, R>) -> R
    

    Delivers the notification to an observer whose handlers return a result, and returns it (Accept<TResult>(IObserver<T, TResult>)).

    Source

    accept_fns

    fn accept_fns<R>(self: Self, on_next: impl FnOnce(T) -> R, on_error: impl FnOnce(ObservableError) -> R, on_completed: impl FnOnce() -> R) -> R
    

    Calls the function for the kind of the notification (Accept(Func<T, TResult>, ...)).

    Source

    to_observable

    fn to_observable(self: &Self) -> Rc<dyn IObservable<T>>
    

    A sequence of the one notification, delivered on the immediate scheduler (ToObservable()).

    Source

    to_observable_on

    fn to_observable_on(self: &Self, scheduler: Rc<dyn IScheduler>) -> Rc<dyn IObservable<T>>
    

    A sequence of the one notification, delivered on scheduler: a value is followed by the end of the sequence (ToObservable(IScheduler)).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • NotificationValue
    • Clone
    • PartialEq
    • Hash
    • Debug

    Availability

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