Skip to main content

SystemEvent

Enum SystemEvent 

Source
pub enum SystemEvent {
Show 20 variants Appear, Disappear, Foreground, Background, Inactive, Terminate, FocusChanged(bool), Resize { width: f32, height: f32, scale_factor: f32, }, SafeAreaChanged(SafeAreaInsets), OrientationChanged(ScreenOrientation), ThemeChanged(ThemeMode), LocaleChanged(String), KeyboardVisibilityChanged { visible: bool, height: f32, }, MemoryWarning(MemoryPressure), LowPowerModeChanged(bool), NetworkStatusChanged(NetworkStatus), BackPressed, DeepLink(String), ClipboardChanged, DeviceMotion(DeviceMotionSample),
}
Expand description

Unified cross-platform system and lifecycle event smoothing all 7-platform OS differences.

Variants§

§

Appear

Active window or routed page became visually presented.

§

Disappear

Active window or routed page ceased to be visually presented.

§

Foreground

Application returned to active foreground execution.

§

Background

Application moved into suspended/hidden background execution.

§

Inactive

Application lost active interaction status (e.g. control center, app switcher, or deactivation).

§

Terminate

Application is terminating gracefully.

§

FocusChanged(bool)

Window keyboard/input focus state changed.

§

Resize

Viewport logical dimensions or DPI scale factor changed.

Fields

§width: f32

Logical viewport width in device-independent pixels.

§height: f32

Logical viewport height in device-independent pixels.

§scale_factor: f32

Display DPI scale factor.

§

SafeAreaChanged(SafeAreaInsets)

Safe-area insets changed (notch, Dynamic Island, system bars, Stage Manager).

§

OrientationChanged(ScreenOrientation)

Device or window orientation changed.

§

ThemeChanged(ThemeMode)

Host OS/browser light or dark theme preference changed.

§

LocaleChanged(String)

Host OS/browser preferred BCP-47 locale changed.

§

KeyboardVisibilityChanged

Soft virtual keyboard / IME visibility or covered height changed.

Fields

§visible: bool

Whether the soft virtual keyboard is currently shown.

§height: f32

Keyboard height in logical pixels (0.0 when hidden).

§

MemoryWarning(MemoryPressure)

Operating system signaled memory pressure.

§

LowPowerModeChanged(bool)

Operating system toggled battery saver / low-power mode.

§

NetworkStatusChanged(NetworkStatus)

Host network connectivity status changed.

§

BackPressed

Hardware/gesture system back navigation was triggered.

Host OS delivered a custom-scheme or universal deep link URI.

§

ClipboardChanged

System clipboard content changed.

§

DeviceMotion(DeviceMotionSample)

Real hardware gyroscope/accelerometer/gravity sensor sample aligned to the current screen axes.

Trait Implementations§

Source§

impl Clone for SystemEvent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CustomEvent for SystemEvent

Marker trait enabling SystemEvent forwarding over EventBus when desired.

Source§

impl Debug for SystemEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SystemEvent

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SystemEvent

Auto Trait Implementations§

§

impl Forget for SystemEvent

§

impl Freeze for SystemEvent
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for SystemEvent

§

impl RefUnwindSafe for SystemEvent

§

impl Send for SystemEvent
where RawVecInner: Send,

§

impl Sync for SystemEvent
where RawVecInner: Sync,

§

impl Unpin for SystemEvent
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for SystemEvent

§

impl UnwindSafe for SystemEvent
where RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.