ObservableExt
trait · ferroui-base · v0.5.0
trait ObservableExt<T: 'static>
Operators available on every shared observable.
Members
subscribe_fn
fn subscribe_fn(self: &Self, on_next: impl Fn(T) -> () + 'static) -> Rc<dyn IDisposable>
Subscribes with a closure invoked for every value.
subscribe_fn_guard
fn subscribe_fn_guard(self: &Self, on_next: impl Fn(T) -> () + 'static) -> Subscription
Subscribes with a closure invoked for every value and returns the guard of the
subscription: dropping it unsubscribes (subscribe_fn returns the
handle, which keeps the subscription when it is dropped).
select
fn select<U: 'static>(self: &Self, f: impl Fn(T) -> U + 'static) -> Rc<dyn IObservable<U>>
Projects each value.
where_
fn where_(self: &Self, f: impl Fn(&T) -> bool + 'static) -> Rc<dyn IObservable<T>>
Filters values.
start_with
fn start_with(self: &Self, value: T) -> Rc<dyn IObservable<T>>
where T: Clone
Produces value to each observer before the values of the source.
combine_latest
fn combine_latest<TSecond: Clone + 'static, TResult: 'static>(self: &Self, second: &Rc<dyn IObservable<TSecond>>, result_selector: impl Fn(T, TSecond) -> TResult + 'static) -> Rc<dyn IObservable<TResult>>
where T: Clone
Combines the latest values of this observable and second with
result_selector, once both have produced a value.
skip
fn skip(self: &Self, skip_count: i32) -> Rc<dyn IObservable<T>>
Leaves out the first skip_count values.
Panics when skip_count is not bigger than zero.
take
fn take(self: &Self, take_count: i32) -> Rc<dyn IObservable<T>>
Produces the first take_count values and completes.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.