FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ObservableBase

    struct · ferroui-reactive · v0.5.0

    struct ObservableBase<T>
    

    An observable whose subscription is the user's ObservableCore (ObservableBase<T>).

    The observer the core receives ignores everything after a terminal notification, and a terminal notification, or a panic while the observer handles a value, disposes the subscription (AutoDetachObserver<T>). When no work of the current-thread scheduler is running, the subscription runs through its trampoline, so that work it schedules there runs after the subscription has been set up.

    View source

    Members

    new

    fn new(core: impl ObservableCore<T> + 'static) -> Self
    

    An observable whose subscription is core (a subclass of ObservableBase<T> upstream).

    Source

    from_fn

    fn from_fn(subscribe_core: impl Fn(Rc<dyn IObserver<T>>) -> Rc<dyn IDisposable> + 'static) -> Self
    

    An observable whose subscription is the function subscribe_core.

    Source

    try_from_fn

    fn try_from_fn(subscribe_core: impl Fn(Rc<dyn IObserver<T>>) -> Result<Rc<dyn IDisposable>, ObservableError> + 'static) -> Self
    

    An observable whose subscription is the function subscribe_core, which may fail: an Err is delivered to the observer as its error (a SubscribeCore that throws upstream).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • SubscribeGuard<T>
    • IObservable<T>

    Availability

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