pub struct Observable<T, Error = ()>{ /* private fields */ }
Expand description
An Observable
represents a sequence of values which
may be observed.
Implementations§
Source§impl<T, Error> Observable<T, Error>
impl<T, Error> Observable<T, Error>
Sourcepub fn subscribe(
&self,
observer: impl Into<BoxedObserver<T, Error>>,
) -> Arc<Subscription<T, Error>>
pub fn subscribe( &self, observer: impl Into<BoxedObserver<T, Error>>, ) -> Arc<Subscription<T, Error>>
Subscribes to the sequence with an observer.
Sourcepub fn map<U, F>(
&self,
map_fn: impl Fn(T) -> U + Send + Sync + 'static,
) -> Observable<U, Error>
pub fn map<U, F>( &self, map_fn: impl Fn(T) -> U + Send + Sync + 'static, ) -> Observable<U, Error>
Returns a new Observable
that performs a map on data from the original.
Sourcepub fn filter<F>(
&self,
filter_fn: impl Fn(T) -> bool + 'static + Send + Sync,
) -> Observable<T, Error>where
T: Clone,
F: SubscriberFunction<T, Error>,
pub fn filter<F>(
&self,
filter_fn: impl Fn(T) -> bool + 'static + Send + Sync,
) -> Observable<T, Error>where
T: Clone,
F: SubscriberFunction<T, Error>,
Returns a new Observable
that filters data specified by the predicate.
Trait Implementations§
Source§impl<T, Error> Clone for Observable<T, Error>
impl<T, Error> Clone for Observable<T, Error>
Auto Trait Implementations§
impl<T, Error> Freeze for Observable<T, Error>
impl<T, Error = ()> !RefUnwindSafe for Observable<T, Error>
impl<T, Error> Send for Observable<T, Error>
impl<T, Error> Sync for Observable<T, Error>
impl<T, Error> Unpin for Observable<T, Error>
impl<T, Error = ()> !UnwindSafe for Observable<T, Error>
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
Mutably borrows from an owned value. Read more