Skip to main content

DeviceMockController

Struct DeviceMockController 

Source
pub struct DeviceMockController { /* private fields */ }
Expand description

Controller allowing programmatic mutation of simulated device telemetry.

Implementations§

Source§

impl DeviceMockController

Source

pub fn new() -> Self

Obtains a controller handle connected to the global hardware telemetry simulation.

Source

pub fn reset_to_defaults(&self)

Resets all simulated device telemetry to standard factory defaults.

Source

pub fn battery(&self) -> BatteryInfo

Gets a copy of current battery info.

Source

pub fn set_battery(&self, info: BatteryInfo)

Updates battery info and notifies reactive signals.

Source

pub fn set_battery_level(&self, level: f32)

Updates battery level in range [0.0, 1.0].

Source

pub fn thermal(&self) -> ThermalState

Gets current thermal state.

Source

pub fn set_thermal(&self, state: ThermalState)

Updates thermal state and notifies reactive signals.

Source

pub fn network(&self) -> NetworkStatus

Gets current network status.

Source

pub fn set_network(&self, status: NetworkStatus)

Updates network status and notifies reactive signals.

Source

pub fn set_online(&self, is_online: bool)

Sets online status.

Source

pub fn screen(&self) -> ScreenGeometry

Gets current screen geometry.

Source

pub fn set_screen(&self, screen: ScreenGeometry)

Updates screen geometry and notifies reactive signals.

Source

pub fn set_safe_area(&self, insets: SafeAreaInsets)

Sets screen safe area insets (notches, dynamic island).

Source

pub fn display_refresh(&self) -> DisplayRefreshInfo

Gets current display refresh info.

Source

pub fn set_display_refresh(&self, info: DisplayRefreshInfo)

Updates display refresh characteristics and capabilities.

Source

pub fn gpu(&self) -> GpuInfo

Gets current GPU info.

Source

pub fn set_gpu(&self, gpu: GpuInfo)

Updates GPU introspection info.

Source

pub fn trigger_memory_pressure(&self, level: MemoryPressure)

Triggers a system memory pressure notification across all registered callbacks.

Trait Implementations§

Source§

impl Clone for DeviceMockController

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 Debug for DeviceMockController

Source§

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

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

impl Default for DeviceMockController

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.