pub struct SystemEventNormalizer { /* private fields */ }Expand description
Deterministic state machine deduplicating noisy OS callbacks and enforcing canonical cross-platform event ordering.
Implementations§
Source§impl SystemEventNormalizer
Canonical cross-platform lifecycle normalization and deduplication state machine.
impl SystemEventNormalizer
Canonical cross-platform lifecycle normalization and deduplication state machine.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new SystemEventNormalizer starting in AppState::Active.
§Returns
Self- Initialized state machine.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Sourcepub fn normalize(&mut self, event: SystemEvent) -> Vec<SystemEvent>
pub fn normalize(&mut self, event: SystemEvent) -> Vec<SystemEvent>
Normalizes a raw platform SystemEvent, deduplicating redundant notifications and synthesizing missing transition edges.
§Arguments
&Self- Mutable normalizer state machine.SystemEvent- Raw platform or synthetic system event.
§Returns
Vec<SystemEvent>- Zero or more canonical events in strict cross-platform order.
Source§impl SystemEventNormalizer
impl SystemEventNormalizer
pub fn get_state(&self) -> AppState
pub fn get_mut_state(&mut self) -> &mut AppState
pub fn set_state(&mut self, val: AppState) -> &mut Self
pub fn get_visible(&self) -> bool
pub fn get_mut_visible(&mut self) -> &mut bool
pub fn set_visible(&mut self, val: bool) -> &mut Self
pub fn get_mut_last_focused(&mut self) -> &mut Option<bool>
pub fn set_last_focused(&mut self, val: Option<bool>) -> &mut Self
pub fn get_mut_last_resize(&mut self) -> &mut Option<(f32, f32, f32)>
pub fn set_last_resize(&mut self, val: Option<(f32, f32, f32)>) -> &mut Self
pub fn get_mut_last_safe_area(&mut self) -> &mut Option<SafeAreaInsets>
pub fn set_last_safe_area(&mut self, val: Option<SafeAreaInsets>) -> &mut Self
pub fn get_mut_last_orientation(&mut self) -> &mut Option<ScreenOrientation>
pub fn set_last_orientation( &mut self, val: Option<ScreenOrientation>, ) -> &mut Self
pub fn get_mut_last_theme(&mut self) -> &mut Option<ThemeMode>
pub fn set_last_theme(&mut self, val: Option<ThemeMode>) -> &mut Self
pub fn get_mut_last_locale(&mut self) -> &mut Option<String>
pub fn set_last_locale(&mut self, val: Option<String>) -> &mut Self
pub fn get_mut_last_keyboard(&mut self) -> &mut Option<(bool, f32)>
pub fn set_last_keyboard(&mut self, val: Option<(bool, f32)>) -> &mut Self
pub fn get_mut_last_low_power(&mut self) -> &mut Option<bool>
pub fn set_last_low_power(&mut self, val: Option<bool>) -> &mut Self
pub fn get_mut_last_network(&mut self) -> &mut Option<NetworkStatus>
pub fn set_last_network(&mut self, val: Option<NetworkStatus>) -> &mut Self
pub fn get_mut_last_device_motion(&mut self) -> &mut Option<DeviceMotionSample>
pub fn set_last_device_motion( &mut self, val: Option<DeviceMotionSample>, ) -> &mut Self
Trait Implementations§
Source§impl Clone for SystemEventNormalizer
impl Clone for SystemEventNormalizer
Source§impl Debug for SystemEventNormalizer
impl Debug for SystemEventNormalizer
Source§impl Default for SystemEventNormalizer
Default active-foreground initial state for SystemEventNormalizer.
impl Default for SystemEventNormalizer
Default active-foreground initial state for SystemEventNormalizer.
Source§impl PartialEq for SystemEventNormalizer
impl PartialEq for SystemEventNormalizer
impl StructuralPartialEq for SystemEventNormalizer
Auto Trait Implementations§
impl Forget for SystemEventNormalizer
impl Freeze for SystemEventNormalizer
impl Move for SystemEventNormalizer
impl RefUnwindSafe for SystemEventNormalizer
impl Send for SystemEventNormalizerwhere
RawVecInner: Send,
impl Sync for SystemEventNormalizerwhere
RawVecInner: Sync,
impl Unpin for SystemEventNormalizer
impl UnsafeUnpin for SystemEventNormalizer
impl UnwindSafe for SystemEventNormalizerwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more