pub enum LifecycleState {
Active,
Inactive,
Background,
Suspended,
}Expand description
The app’s OS-level lifecycle state (D042’s four states).
Mobile semantics (the reason this exists — see .steering/PHASE_29.md):
iOS maps applicationDidBecomeActive/WillResignActive/
DidEnterBackground/WillTerminate, Android maps
onResume/onPause/onStop (Android has no pre-kill callback, so
Suspended is iOS-only in practice). Desktop apps simply stay Active
— the default — since no host reports otherwise (desktop lifecycle is
explicitly out of Phase 29’s scope).
Variants§
Active
Foreground, receiving events. The startup default: by the time any component can observe this atom, the app is running in front.
Inactive
Foreground but not receiving events (iOS: transitional — system
dialogs, app switcher, incoming call; Android: onPause).
Background
Not visible; still in memory (iOS: didEnterBackground, Android:
onStop). Pause expensive work (animation, polling) here.
Suspended
About to be terminated by the OS (iOS: applicationWillTerminate).
Last chance to persist state — there may be no further frames.
Trait Implementations§
Source§impl Clone for LifecycleState
impl Clone for LifecycleState
Source§fn clone(&self) -> LifecycleState
fn clone(&self) -> LifecycleState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more