pub trait ObservableExt<T: 'static> {
// Required methods
fn subscribe_fn(&self, on_next: impl Fn(T) + 'static) -> Rc<dyn IDisposable>;
fn select<U: 'static>(
&self,
f: impl Fn(T) -> U + 'static,
) -> Rc<dyn IObservable<U>>;
fn where_(&self, f: impl Fn(&T) -> bool + 'static) -> Rc<dyn IObservable<T>>;
fn start_with(&self, value: T) -> Rc<dyn IObservable<T>>
where T: Clone;
fn combine_latest<TSecond: Clone + 'static, TResult: 'static>(
&self,
second: &Rc<dyn IObservable<TSecond>>,
result_selector: impl Fn(T, TSecond) -> TResult + 'static,
) -> Rc<dyn IObservable<TResult>>
where T: Clone;
fn skip(&self, skip_count: i32) -> Rc<dyn IObservable<T>>;
fn take(&self, take_count: i32) -> Rc<dyn IObservable<T>>;
}Expand description
Operators available on every shared observable.
Required Methods§
Sourcefn subscribe_fn(&self, on_next: impl Fn(T) + 'static) -> Rc<dyn IDisposable>
fn subscribe_fn(&self, on_next: impl Fn(T) + 'static) -> Rc<dyn IDisposable>
Subscribes with a closure invoked for every value.
Sourcefn select<U: 'static>(
&self,
f: impl Fn(T) -> U + 'static,
) -> Rc<dyn IObservable<U>>
fn select<U: 'static>( &self, f: impl Fn(T) -> U + 'static, ) -> Rc<dyn IObservable<U>>
Projects each value.
Sourcefn start_with(&self, value: T) -> Rc<dyn IObservable<T>>where
T: Clone,
fn start_with(&self, value: T) -> Rc<dyn IObservable<T>>where
T: Clone,
Produces value to each observer before the values of the source.
Sourcefn combine_latest<TSecond: Clone + 'static, TResult: 'static>(
&self,
second: &Rc<dyn IObservable<TSecond>>,
result_selector: impl Fn(T, TSecond) -> TResult + 'static,
) -> Rc<dyn IObservable<TResult>>where
T: Clone,
fn combine_latest<TSecond: Clone + 'static, TResult: 'static>(
&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.
Sourcefn skip(&self, skip_count: i32) -> Rc<dyn IObservable<T>>
fn skip(&self, skip_count: i32) -> Rc<dyn IObservable<T>>
Leaves out the first skip_count values.
Panics when skip_count is not bigger than zero.
Sourcefn take(&self, take_count: i32) -> Rc<dyn IObservable<T>>
fn take(&self, take_count: i32) -> Rc<dyn IObservable<T>>
Produces the first take_count values and completes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".