pub enum Event<T, E> {
Next(T),
Termination(Termination<E>),
}Variants§
Next(T)
Termination(Termination<E>)
Trait Implementations§
Source§impl<'or, 'sub, T, E, OE> Observable<'or, 'sub, Event<T, E>, Infallible> for Materialize<OE>where
OE: Observable<'or, 'sub, T, E>,
impl<'or, 'sub, T, E, OE> Observable<'or, 'sub, Event<T, E>, Infallible> for Materialize<OE>where
OE: Observable<'or, 'sub, T, E>,
Source§fn subscribe(
self,
observer: impl Observer<Event<T, E>, Infallible> + NecessarySendSync + 'or,
) -> Subscription<'sub>
fn subscribe( self, observer: impl Observer<Event<T, E>, Infallible> + NecessarySendSync + 'or, ) -> Subscription<'sub>
Subscribes an observer to this observable. When an observer is subscribed, it will start receiving events from the observable.
The
subscribe method returns a Subscription which can be used to unsubscribe the observer from the observable.
We use Subscription struct instead of trait like impl Cancellable, because we need to cancel the subscription when the Subscription is dropped. It’s not possible to implement Drop for a trait object.impl<T, E> Eq for Event<T, E>
Auto Trait Implementations§
impl<T, E> Freeze for Event<T, E>
impl<T, E> RefUnwindSafe for Event<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for Event<T, E>
impl<T, E> Sync for Event<T, E>
impl<T, E> Unpin for Event<T, E>
impl<T, E> UnwindSafe for Event<T, E>where
T: UnwindSafe,
E: UnwindSafe,
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