ISuspensionHost
trait · ferroui-reactiveui · v0.5.0
trait ISuspensionHost: IReactiveObject
The events of the life of the process that the host operating system publishes, in one form
(ISuspensionHost): subscribe to them to save and restore the state of the application when
it is suspended and resumed.
The observables abstract the terms of each platform ("launching", "activated", "closing") so
that shared code persists its state without knowing the user-interface toolkit. Most
applications call
setup_default_suspend_resume
at startup; the observables are settable so that a host can plug in its own monitoring.
The state of the application is an object the application defines, type-erased here
(app_state); create_new_app_state makes a
fresh one on the first launch or after a crash.
Members
is_launching_newset_is_launching_newis_resumingset_is_resumingis_unpausingset_is_unpausingshould_persist_stateset_should_persist_stateshould_invalidate_stateset_should_invalidate_statecreate_new_app_stateset_create_new_app_stateapp_stateset_app_state
is_launching_new
fn is_launching_new(self: &Self) -> Rc<dyn IObservable<()>>
Ticks when the application is launched anew, after a crash or the first time: the
application creates its state from scratch (IsLaunchingNew).
set_is_launching_new
fn set_is_launching_new(self: &Self, value: Rc<dyn IObservable<()>>)
Sets is_launching_new.
is_resuming
fn is_resuming(self: &Self) -> Rc<dyn IObservable<()>>
Ticks when the application resumes from the suspended state: it was running, but its
process was destroyed (IsResuming).
set_is_resuming
fn set_is_resuming(self: &Self, value: Rc<dyn IObservable<()>>)
Sets is_resuming.
is_unpausing
fn is_unpausing(self: &Self) -> Rc<dyn IObservable<()>>
Ticks when the application is activated; the process may not have been running before
(IsUnpausing).
set_is_unpausing
fn set_is_unpausing(self: &Self, value: Rc<dyn IObservable<()>>)
Sets is_unpausing.
should_persist_state
fn should_persist_state(self: &Self) -> Rc<dyn IObservable<Rc<dyn IDisposable>>>
Ticks when the application should persist its state; the value is disposed once the state
is persisted (ShouldPersistState).
set_should_persist_state
fn set_should_persist_state(self: &Self, value: Rc<dyn IObservable<Rc<dyn IDisposable>>>)
Sets should_persist_state.
should_invalidate_state
fn should_invalidate_state(self: &Self) -> Rc<dyn IObservable<()>>
Ticks when the saved state should be deleted, usually after a crash
(ShouldInvalidateState).
set_should_invalidate_state
fn set_should_invalidate_state(self: &Self, value: Rc<dyn IObservable<()>>)
Sets should_invalidate_state.
create_new_app_state
fn create_new_app_state(self: &Self) -> Option<AppStateFactory>
The function that creates a new state of the application (CreateNewAppState).
set_create_new_app_state
fn set_create_new_app_state(self: &Self, value: Option<AppStateFactory>)
Sets create_new_app_state.
app_state
fn app_state(self: &Self) -> Option<Rc<dyn Any>>
The current state of the application (AppState); see
get_app_state for a typed view.
set_app_state
fn set_app_state(self: &Self, value: Option<Rc<dyn Any>>)
Sets app_state.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.