FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SuspensionHost

    struct · ferroui-reactiveui · v0.5.0

    struct SuspensionHost
    

    The state of the suspension of an application, which a platform helper sets up (SuspensionHost): the default ISuspensionHost of RxSuspension.

    The platform pushes its events into the settable observables; view models subscribe through ISuspensionHost. Each observable replays the latest one set, so an observable set after a subscription is followed by it. Until a helper sets them, the observables fail on subscription.

    use ferroui_reactive::Observable;
    use ferroui_reactiveui::{ISuspensionHost, SuspensionHost};
    use std::rc::Rc;
    
    let host = SuspensionHost::new();
    host.set_is_launching_new(Observable::return_(()));
    host.set_create_new_app_state(Some(Rc::new(|| Rc::new(String::from("shell")) as Rc<dyn std::any::Any>)));
    let factory = host.create_new_app_state().unwrap();
    host.set_app_state(Some(factory()));
    assert!(host.app_state().is_some());
    

    View source

    Members

    new

    fn new() -> Rc<Self>
    

    A host whose observables fail on subscription until a helper sets them (SuspensionHost()).

    Source

    Trait implementations

    Availability

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