pub struct DeviceContext {Show 18 fields
pub name: Option<String>,
pub family: Option<String>,
pub model: Option<String>,
pub model_id: Option<String>,
pub arch: Option<String>,
pub battery_level: Option<f32>,
pub orientation: Option<Orientation>,
pub simulator: Option<bool>,
pub memory_size: Option<u64>,
pub free_memory: Option<u64>,
pub usable_memory: Option<u64>,
pub storage_size: Option<u64>,
pub free_storage: Option<u64>,
pub external_storage_size: Option<u64>,
pub external_free_storage: Option<u64>,
pub boot_time: Option<SystemTime>,
pub timezone: Option<String>,
pub other: BTreeMap<String, Value>,
}
Expand description
Holds device information.
Fields§
§name: Option<String>
The name of the device.
family: Option<String>
The family of the device model.
model: Option<String>
The device model (human readable).
model_id: Option<String>
The device model (internal identifier).
arch: Option<String>
The native cpu architecture of the device.
battery_level: Option<f32>
The current battery level (0-100).
orientation: Option<Orientation>
The current screen orientation.
simulator: Option<bool>
Simulator/prod indicator.
memory_size: Option<u64>
Total memory available in byts.
free_memory: Option<u64>
How much memory is still available in bytes.
usable_memory: Option<u64>
How much memory is usable for the app in bytes.
storage_size: Option<u64>
Total storage size of the device in bytes.
free_storage: Option<u64>
How much storage is free in bytes.
external_storage_size: Option<u64>
Total size of the attached external storage in bytes (eg: android SDK card).
external_free_storage: Option<u64>
Free size of the attached external storage in bytes (eg: android SDK card).
boot_time: Option<SystemTime>
Optionally an indicator when the device was booted.
timezone: Option<String>
The timezone of the device.
other: BTreeMap<String, Value>
Additional arbitrary fields for forwards compatibility.
Trait Implementations§
source§impl Clone for DeviceContext
impl Clone for DeviceContext
source§fn clone(&self) -> DeviceContext
fn clone(&self) -> DeviceContext
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DeviceContext
impl Debug for DeviceContext
source§impl Default for DeviceContext
impl Default for DeviceContext
source§fn default() -> DeviceContext
fn default() -> DeviceContext
source§impl<'de> Deserialize<'de> for DeviceContext
impl<'de> Deserialize<'de> for DeviceContext
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeviceContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeviceContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl From<DeviceContext> for Context
impl From<DeviceContext> for Context
source§fn from(data: DeviceContext) -> Context
fn from(data: DeviceContext) -> Context
source§impl PartialEq for DeviceContext
impl PartialEq for DeviceContext
source§impl Serialize for DeviceContext
impl Serialize for DeviceContext
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for DeviceContext
Auto Trait Implementations§
impl Freeze for DeviceContext
impl RefUnwindSafe for DeviceContext
impl Send for DeviceContext
impl Sync for DeviceContext
impl Unpin for DeviceContext
impl UnwindSafe for DeviceContext
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)