FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    AutoSuspendHelper

    struct · ferroui-reactiveui-controls · v0.5.0

    struct AutoSuspendHelper
    

    Automatic suspension and state persistence for FerroUI applications (AutoSuspendHelper).

    Pass the application's lifetime object to new, and call on_framework_initialization_completed from the application's on_framework_initialization_completed to signal the launch. The helper connects ReactiveUI's suspension host (RxSuspension) to the exit of the application and to unhandled errors. It does not persist state in design mode.

    Deviation (DEVIATIONS.md, ReactiveUI controls): the helper is shared (Rc), and released with dispose.

    View source

    Members

    new

    fn new(lifetime: Option<&dyn IApplicationLifetime>) -> Rc<Self>
    

    Connects the suspension host to lifetime (AutoSuspendHelper(IApplicationLifetime)).

    In design mode, state persistence is disabled. A controlled lifetime has its exit wired to the persistence of the state. Call it after the application is initialized.

    Panics

    When lifetime is None (ArgumentNullException), and when the lifetime is not a controlled one, whose exit the helper cannot detect (NotSupportedException).

    Source

    on_framework_initialization_completed

    fn on_framework_initialization_completed(self: &Self)
    

    Signals that the framework initialization has completed (OnFrameworkInitializationCompleted): notifies the launch of the application.

    Source

    on_unhandled_exception

    fn on_unhandled_exception(self: &Self)
    

    Invalidates the persisted state after an unhandled error (OnUnhandledException).

    Deviation (DEVIATIONS.md, ReactiveUI controls): upstream subscribes to AppDomain.UnhandledException; Rust has no such event of the process, so the application calls this method where it handles a failure (a panic hook, the handler of a dispatcher).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • IEnableLogger
    • IDisposable

    Availability

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