LightweightObservableBase
struct · ferroui-base · v0.5.0
struct LightweightObservableBase<T>
The state of a lightweight observable: its observers, notified in subscription order, and the error it failed with. Once it completes or fails, the list is gone and later subscribers are told so at once.
Members
new
fn new() -> Self
has_observers
fn has_observers(self: &Self) -> bool
Whether any observer is subscribed.
subscribe
fn subscribe<O: LightweightObservable<T>>(owner: &Rc<O>, observer: Rc<dyn IObserver<T>>) -> Rc<dyn IDisposable>
where T: 'static
Subscribes observer to owner. The first subscription initializes
the owner; disposing the returned handle removes the observer.
publish_next
fn publish_next(self: &Self, value: T)
where T: Clone
Notifies every observer of a value.
publish_completed
fn publish_completed<O: LightweightObservable<T>>(owner: &O)
Completes the observable: notifies every observer and deinitializes the owner.
publish_error
fn publish_error<O: LightweightObservable<T>>(owner: &O, error: ObservableError)
Fails the observable: notifies every observer and deinitializes the owner.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.