pub struct Observable;Expand description
Factory functions for observables.
Implementations§
Source§impl Observable
impl Observable
Sourcepub fn create<T: 'static>(
subscribe: impl Fn(Rc<dyn IObserver<T>>) -> Rc<dyn IDisposable> + 'static,
) -> Rc<dyn IObservable<T>>
pub 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.
Sourcepub fn return_<T: Clone + 'static>(value: T) -> Rc<dyn IObservable<T>>
pub fn return_<T: Clone + 'static>(value: T) -> Rc<dyn IObservable<T>>
An observable that produces a single value and completes.
Sourcepub fn single_value<T: Clone + 'static>(value: T) -> Rc<dyn IObservable<T>>
pub fn single_value<T: Clone + 'static>(value: T) -> Rc<dyn IObservable<T>>
An observable that produces a single value and never completes.
Sourcepub fn never<T: 'static>() -> Rc<dyn IObservable<T>>
pub fn never<T: 'static>() -> Rc<dyn IObservable<T>>
An observable that never produces a value.
Sourcepub fn empty<T: 'static>() -> Rc<dyn IObservable<T>>
pub fn empty<T: 'static>() -> Rc<dyn IObservable<T>>
An observable that completes immediately.
Sourcepub fn switch<TSource: 'static>(
sources: Rc<dyn IObservable<Rc<dyn IObservable<TSource>>>>,
) -> Rc<dyn IObservable<TSource>>
pub 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.
Sourcepub fn combine_latest_all<TInput: Clone + 'static>(
inputs: impl IntoIterator<Item = Rc<dyn IObservable<TInput>>>,
) -> Rc<dyn IObservable<Vec<TInput>>>
pub 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.
Sourcepub fn from_event_pattern<T: Clone + 'static>(
add_handler: impl Fn(Rc<dyn Fn(&T)>) -> Rc<dyn IDisposable> + 'static,
) -> Rc<dyn IObservable<T>>
pub 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).
Auto Trait Implementations§
impl Freeze for Observable
impl RefUnwindSafe for Observable
impl Send for Observable
impl Sync for Observable
impl Unpin for Observable
impl UnsafeUnpin for Observable
impl UnwindSafe for Observable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more