FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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>).

    View source

    Members

    new

    fn new(value: T) -> Rc<Self>
    

    A subject whose value is value until it receives one.

    Source

    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.

    Source

    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.

    Source

    as_observable

    fn as_observable(self: &Rc<Self>) -> Rc<dyn IObservable<T>>
    

    Source

    as_observer

    fn as_observer(self: &Rc<Self>) -> Rc<dyn IObserver<T>>
    

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.