FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    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).

    Source

    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).

    Source

    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>)).

    Source

    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)).

    Source

    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>?>).

    Source

    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)).

    Source

    Trait implementations

    Availability

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