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.
Members
OnNextOnErrorOnCompletedkindhas_valuevalueexceptionacceptaccept_observer_with_resultaccept_fnsto_observableto_observable_on
OnNext
OnNext(T)
A value (Notification.CreateOnNext).
OnError
OnError(ferroui_system::ObservableError)
An error (Notification.CreateOnError).
OnCompleted
OnCompleted
The end of the sequence (Notification.CreateOnCompleted).
kind
fn kind(self: &Self) -> NotificationKind
The kind of the notification (Kind).
has_value
fn has_value(self: &Self) -> bool
Whether the notification has a value (HasValue).
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.
exception
fn exception(self: &Self) -> Option<&ObservableError>
The error of an OnError notification (Exception).
accept
fn accept(self: Self, observer: &dyn IObserver<T>)
Delivers the notification to an observer (Accept(IObserver<T>)).
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>)).
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>, ...)).
to_observable
fn to_observable(self: &Self) -> Rc<dyn IObservable<T>>
A sequence of the one notification, delivered on the immediate scheduler (ToObservable()).
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)).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedNotificationValueClonePartialEqHashDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.