SwitchSubscribeMixins
trait · ferroui-reactiveui · v0.5.0
trait SwitchSubscribeMixins<S: 'static>
The extension methods of SwitchSubscribeMixins on an observable of optional values S.
Deviation (DEVIATIONS.md, ReactiveUI): upstream overloads SwitchSubscribe and SwitchSelect
on the element type and on the handlers; here the forms with a selector are
switch_select and switch_subscribe_with*, the forms on observables
and commands are switch_subscribe and
switch_subscribe_all, and the forms with an error and an end
handler end in _all. The null checks of the arguments have no counterpart.
Members
switch_selecttry_switch_selectswitch_subscribe_withswitch_subscribe_with_allswitch_subscribeswitch_subscribe_all
switch_select
fn switch_select<U: 'static>(self: &Self, selector: impl Fn(S) -> Rc<dyn IObservable<U>> + 'static) -> Rc<dyn IObservable<U>>
Projects each value that is not None to an observable and notifies the values of the
latest one (SwitchSelect<TResult>(Func<TSource, IObservable<TResult>>), and the form on
commands).
try_switch_select
fn try_switch_select<U: 'static>(self: &Self, selector: impl Fn(S) -> Result<Rc<dyn IObservable<U>>, ObservableError> + 'static) -> Rc<dyn IObservable<U>>
switch_select with a selector that may fail; a failure is the error
of the sequence (the selector that throws upstream).
switch_subscribe_with
fn switch_subscribe_with<U: 'static>(self: &Self, selector: impl Fn(S) -> Rc<dyn IObservable<U>> + 'static, on_next: impl Fn(U) -> () + 'static) -> Rc<dyn IDisposable>
Subscribes on_next to switch_select; an error is ignored
(SwitchSubscribe<TResult>(Func<TSource, IObservable<TResult>>, Action<TResult>)).
switch_subscribe_with_all
fn switch_subscribe_with_all<U: 'static>(self: &Self, selector: impl Fn(S) -> Rc<dyn IObservable<U>> + 'static, on_next: impl Fn(U) -> () + 'static, on_error: impl Fn(ObservableError) -> () + 'static, on_completed: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
Subscribes the three handlers to switch_select
(SwitchSubscribe<TResult>(Func<TSource, IObservable<TResult>>, Action<TResult>, Action<Exception>, Action)).
switch_subscribe
fn switch_subscribe<T: 'static>(self: &Self, on_next: impl Fn(T) -> () + 'static) -> Rc<dyn IDisposable>
where S: SwitchSource<T>
Subscribes on_next to the values of the latest observable (or command) the source
notified; an error is ignored (SwitchSubscribe(Action<T>) on IObservable<IObservable<T>?>
and on IObservable<IReactiveCommand<TParam, TResult>?>).
switch_subscribe_all
fn switch_subscribe_all<T: 'static>(self: &Self, on_next: impl Fn(T) -> () + 'static, on_error: impl Fn(ObservableError) -> () + 'static, on_completed: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
where S: SwitchSource<T>
switch_subscribe with the error and end handlers
(SwitchSubscribe(Action<T>, Action<Exception>, Action)).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.