Observable
struct · ferroui-base · v0.5.0
struct Observable
Factory functions for observables.
Members
create
fn create<T: 'static>(subscribe: impl Fn(Rc<dyn IObserver<T>>) -> Rc<dyn IDisposable> + 'static) -> Rc<dyn IObservable<T>>
Creates an observable from a subscribe function.
return_
fn return_<T: Clone + 'static>(value: T) -> Rc<dyn IObservable<T>>
An observable that produces a single value and completes.
single_value
fn single_value<T: Clone + 'static>(value: T) -> Rc<dyn IObservable<T>>
An observable that produces a single value and never completes.
never
fn never<T: 'static>() -> Rc<dyn IObservable<T>>
An observable that never produces a value.
empty
fn empty<T: 'static>() -> Rc<dyn IObservable<T>>
An observable that completes immediately.
switch
fn switch<TSource: 'static>(sources: Rc<dyn IObservable<Rc<dyn IObservable<TSource>>>>) -> Rc<dyn IObservable<TSource>>
Forwards the values of the most recent of the observables that
sources produces.
combine_latest_all
fn combine_latest_all<TInput: Clone + 'static>(inputs: impl IntoIterator<Item = Rc<dyn IObservable<TInput>>>) -> Rc<dyn IObservable<Vec<TInput>>>
Combines the latest values of a sequence of observables: once every one of them has produced a value, each new value produces the list of the latest ones.
from_event_pattern
fn from_event_pattern<T: Clone + 'static>(add_handler: impl Fn(Rc<dyn Fn(&T) -> ()>) -> Rc<dyn IDisposable> + 'static) -> Rc<dyn IObservable<T>>
An observable of the arguments of an event.
add_handler adds the handler it is given to the event and returns
the handle that removes it, as the events of this crate do (the
original takes one function to add and one to remove a handler, for
events with and without typed arguments).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.