BehaviorSubject
struct · ferroui-reactive · v0.5.0
struct BehaviorSubject<T>
A subject that keeps the latest value and hands it to each observer that subscribes, then
every later notification (BehaviorSubject<T>).
Members
new
fn new(value: T) -> Rc<Self>
A subject whose value is value until it receives one.
value
fn value(self: &Self) -> Result<T, ObservableError>
The latest value (Value): the error when the subject ended with one, where upstream
throws it. Panics when the subject has been disposed.
try_get_value
fn try_get_value(self: &Self) -> Result<Option<T>, ObservableError>
The latest value, or None once the subject has been disposed (TryGetValue); the error
when the subject ended with one.
as_observable
fn as_observable(self: &Rc<Self>) -> Rc<dyn IObservable<T>>
as_observer
fn as_observer(self: &Rc<Self>) -> Rc<dyn IObserver<T>>
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeISubjectHandle<A, B>ISubject<A, B>Borrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnySubscribeGuard<T>IObserver<T>IObservable<T>IDisposableSubjectBase<T>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.