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.
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).
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.
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).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherIEnableLoggerIDisposable
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.