FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ConnectableObservableExt

    trait · ferroui-reactive · v0.5.0

    trait ConnectableObservableExt<T: 'static>
    

    The operators of a connectable observable, as methods of its handle (the extension methods of upstream's Observable on IConnectableObservable<TSource>: RefCount, AutoConnect).

    The one required method gives the connectable observable as a handle; every operator is a provided method, declared in the module of its family (ref_count, auto_connect). The trait is implemented for Rc<dyn IConnectableObservable<T>>, which is also a handle of ObservableExt, so the other operators apply to it as well.

    View source

    Members

    connectable

    fn connectable(self: &Self) -> Rc<dyn IConnectableObservable<T>>
    

    The connectable observable as the handle the operators take.

    Source

    ref_count

    fn ref_count(self: &Self) -> std::rc::Rc<dyn ferroui_system::IObservable<T>>
    

    A sequence that connects when it gets its first observer and disconnects when the last one leaves (RefCount()).

    Source

    ref_count_min

    fn ref_count_min(self: &Self, min_observers: usize) -> std::rc::Rc<dyn ferroui_system::IObservable<T>>
    

    ref_count that connects when it has min_observers observers (RefCount(int)). Panics when min_observers is zero.

    Source

    ref_count_with_delay

    fn ref_count_with_delay(self: &Self, disconnect_delay: std::time::Duration) -> std::rc::Rc<dyn ferroui_system::IObservable<T>>
    

    ref_count that disconnects disconnect_delay after the last observer leaves, unless an observer comes meanwhile, on the default scheduler (RefCount(TimeSpan)).

    Source

    ref_count_with_delay_on

    fn ref_count_with_delay_on(self: &Self, disconnect_delay: std::time::Duration, scheduler: std::rc::Rc<dyn crate::concurrency::IScheduler>) -> std::rc::Rc<dyn ferroui_system::IObservable<T>>
    

    ref_count_with_delay on scheduler (RefCount(TimeSpan, IScheduler)).

    Source

    ref_count_min_with_delay

    fn ref_count_min_with_delay(self: &Self, min_observers: usize, disconnect_delay: std::time::Duration) -> std::rc::Rc<dyn ferroui_system::IObservable<T>>
    

    ref_count_with_delay that connects when it has min_observers observers (RefCount(int, TimeSpan)). Panics when min_observers is zero.

    Source

    ref_count_min_with_delay_on

    fn ref_count_min_with_delay_on(self: &Self, min_observers: usize, disconnect_delay: std::time::Duration, scheduler: std::rc::Rc<dyn crate::concurrency::IScheduler>) -> std::rc::Rc<dyn ferroui_system::IObservable<T>>
    

    ref_count_min_with_delay on scheduler (RefCount(int, TimeSpan, IScheduler)). Panics when min_observers is zero.

    Source

    auto_connect

    fn auto_connect(self: &Self) -> std::rc::Rc<dyn ferroui_system::IObservable<T>>
    

    A sequence that connects the source when it gets its first observer (AutoConnect()).

    Source

    auto_connect_min

    fn auto_connect_min(self: &Self, min_observers: usize) -> std::rc::Rc<dyn ferroui_system::IObservable<T>>
    

    A sequence that connects the source when it has min_observers observers; zero connects it at once (AutoConnect(int)).

    Source

    auto_connect_with

    fn auto_connect_with(self: &Self, min_observers: usize, on_connect: impl FnOnce(std::rc::Rc<dyn ferroui_system::IDisposable>) -> () + 'static) -> std::rc::Rc<dyn ferroui_system::IObservable<T>>
    

    auto_connect_min that hands the connection to on_connect, with which the source can be disconnected (AutoConnect(int, Action<IDisposable>)).

    Source

    get_awaiter

    fn get_awaiter(self: Self) -> ferroui_system::task::Shared<Result<T, ferroui_system::ObservableError>>
    where Self: Sized,
          T: Clone
    

    Subscribes to the sequence, connects it, and gives a task of its last value (GetAwaiter(IConnectableObservable<TSource>)); see ObservableExt::get_awaiter.

    Source

    run_async

    fn run_async(self: Self, token: ferroui_system::threading::CancellationToken) -> ferroui_system::task::Shared<Result<T, ferroui_system::ObservableError>>
    where Self: Sized,
          T: Clone
    

    get_awaiter that the cancellation of token cancels, disposing the subscription and the connection; a token canceled already cancels the task without subscribing or connecting (RunAsync(IConnectableObservable<TSource>, CancellationToken)).

    Source

    Trait implementations

    Availability

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