pub struct Observer<T, Error = ()>{
pub next: Box<dyn Fn(T) + Sync + Send>,
pub error: Box<dyn Fn(Error) + Sync + Send>,
pub complete: Box<dyn Fn() + Sync + Send>,
pub start: Box<dyn ObserverStartFunction<T, Error>>,
}Expand description
An Observer is used to receive data from an Observable, and
is supplied as an argument to subscribe.
Fields§
§next: Box<dyn Fn(T) + Sync + Send>Receives the next value in the sequence.
error: Box<dyn Fn(Error) + Sync + Send>Receives the sequence error.
complete: Box<dyn Fn() + Sync + Send>Receives a completion notification.
start: Box<dyn ObserverStartFunction<T, Error>>Receives the subscription object when subscribe is called.
Trait Implementations§
Source§impl<T, Error> AbstractObserver<T, Error> for Observer<T, Error>
impl<T, Error> AbstractObserver<T, Error> for Observer<T, Error>
Source§fn start(&self, subscription: Arc<Subscription<T, Error>>)
fn start(&self, subscription: Arc<Subscription<T, Error>>)
Receives the subscription object when
subscribe is called.Auto Trait Implementations§
impl<T, Error> Freeze for Observer<T, Error>
impl<T, Error = ()> !RefUnwindSafe for Observer<T, Error>
impl<T, Error> Send for Observer<T, Error>
impl<T, Error> Sync for Observer<T, Error>
impl<T, Error> Unpin for Observer<T, Error>
impl<T, Error = ()> !UnwindSafe for Observer<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