Struct relay_event_schema::protocol::DeviceContext
source · pub struct DeviceContext {Show 41 fields
pub name: Annotated<String>,
pub family: Annotated<String>,
pub model: Annotated<String>,
pub model_id: Annotated<String>,
pub arch: Annotated<String>,
pub battery_level: Annotated<f64>,
pub orientation: Annotated<String>,
pub manufacturer: Annotated<String>,
pub brand: Annotated<String>,
pub screen_resolution: Annotated<String>,
pub screen_width_pixels: Annotated<u64>,
pub screen_height_pixels: Annotated<u64>,
pub screen_density: Annotated<f64>,
pub screen_dpi: Annotated<u64>,
pub online: Annotated<bool>,
pub charging: Annotated<bool>,
pub low_memory: Annotated<bool>,
pub simulator: Annotated<bool>,
pub memory_size: Annotated<u64>,
pub free_memory: Annotated<u64>,
pub usable_memory: Annotated<u64>,
pub storage_size: Annotated<u64>,
pub free_storage: Annotated<u64>,
pub external_storage_size: Annotated<u64>,
pub external_free_storage: Annotated<u64>,
pub boot_time: Annotated<String>,
pub timezone: Annotated<String>,
pub locale: Annotated<String>,
pub processor_count: Annotated<u64>,
pub cpu_description: Annotated<String>,
pub processor_frequency: Annotated<u64>,
pub device_type: Annotated<String>,
pub battery_status: Annotated<String>,
pub device_unique_identifier: Annotated<String>,
pub supports_vibration: Annotated<bool>,
pub supports_accelerometer: Annotated<bool>,
pub supports_gyroscope: Annotated<bool>,
pub supports_audio: Annotated<bool>,
pub supports_location_service: Annotated<bool>,
pub uuid: Annotated<Uuid>,
pub other: Object<Value>,
}
Expand description
Device information.
Device context describes the device that caused the event. This is most appropriate for mobile applications.
Fields§
§name: Annotated<String>
Name of the device.
family: Annotated<String>
Family of the device model.
This is usually the common part of model names across generations. For instance, iPhone
would be a reasonable family, so would be Samsung Galaxy
.
model: Annotated<String>
Device model.
This, for example, can be Samsung Galaxy S3
.
model_id: Annotated<String>
Device model (internal identifier).
An internal hardware revision to identify the device exactly.
arch: Annotated<String>
Native cpu architecture of the device.
battery_level: Annotated<f64>
Current battery level in %.
If the device has a battery, this can be a floating point value defining the battery level (in the range 0-100).
orientation: Annotated<String>
Current screen orientation.
This can be a string portrait
or landscape
to define the orientation of a device.
manufacturer: Annotated<String>
Manufacturer of the device.
brand: Annotated<String>
Brand of the device.
screen_resolution: Annotated<String>
Device screen resolution.
(e.g.: 800x600, 3040x1444)
screen_width_pixels: Annotated<u64>
Width of the screen in pixels.
screen_height_pixels: Annotated<u64>
Height of the screen in pixels.
screen_density: Annotated<f64>
Device screen density.
screen_dpi: Annotated<u64>
Screen density as dots-per-inch.
online: Annotated<bool>
Whether the device was online or not.
charging: Annotated<bool>
Whether the device was charging or not.
low_memory: Annotated<bool>
Whether the device was low on memory.
simulator: Annotated<bool>
Simulator/prod indicator.
memory_size: Annotated<u64>
Total memory available in bytes.
free_memory: Annotated<u64>
How much memory is still available in bytes.
usable_memory: Annotated<u64>
How much memory is usable for the app in bytes.
storage_size: Annotated<u64>
Total storage size of the device in bytes.
free_storage: Annotated<u64>
How much storage is free in bytes.
external_storage_size: Annotated<u64>
Total size of the attached external storage in bytes (eg: android SDK card).
external_free_storage: Annotated<u64>
Free size of the attached external storage in bytes (eg: android SDK card).
boot_time: Annotated<String>
Indicator when the device was booted.
timezone: Annotated<String>
Timezone of the device.
locale: Annotated<String>
ISO 639-1 code of the locale the device is set to.
processor_count: Annotated<u64>
Number of “logical processors”.
For example, 8.
cpu_description: Annotated<String>
CPU description.
For example, Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz.
processor_frequency: Annotated<u64>
Processor frequency in MHz.
Note that the actual CPU frequency might vary depending on current load and power conditions, especially on low-powered devices like phones and laptops.
device_type: Annotated<String>
Kind of device the application is running on.
For example, Unknown
, Handheld
, Console
, Desktop
.
battery_status: Annotated<String>
Status of the device’s battery.
For example, Unknown
, Charging
, Discharging
, NotCharging
, Full
.
device_unique_identifier: Annotated<String>
Unique device identifier.
supports_vibration: Annotated<bool>
Whether vibration is available on the device.
supports_accelerometer: Annotated<bool>
Whether the accelerometer is available on the device.
supports_gyroscope: Annotated<bool>
Whether the gyroscope is available on the device.
supports_audio: Annotated<bool>
Whether audio is available on the device.
supports_location_service: Annotated<bool>
Whether location support is available on the device.
uuid: Annotated<Uuid>
UUID of the device.
other: Object<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 DefaultContext for DeviceContext
impl DefaultContext for DeviceContext
source§fn default_key() -> &'static str
fn default_key() -> &'static str
Contexts
.source§fn from_context(context: Context) -> Option<Self>
fn from_context(context: Context) -> Option<Self>
source§fn cast(context: &Context) -> Option<&Self>
fn cast(context: &Context) -> Option<&Self>
source§fn cast_mut(context: &mut Context) -> Option<&mut Self>
fn cast_mut(context: &mut Context) -> Option<&mut Self>
source§fn into_context(self) -> Context
fn into_context(self) -> Context
source§impl Empty for DeviceContext
impl Empty for DeviceContext
source§impl FromValue for DeviceContext
impl FromValue for DeviceContext
source§fn from_value(__value: Annotated<Value>) -> Annotated<Self>
fn from_value(__value: Annotated<Value>) -> Annotated<Self>
source§impl IntoValue for DeviceContext
impl IntoValue for DeviceContext
source§fn into_value(self) -> Value
fn into_value(self) -> Value
source§fn serialize_payload<S>(
&self,
__serializer: S,
__behavior: SkipSerialization,
) -> Result<S::Ok, S::Error>where
Self: Sized,
S: Serializer,
fn serialize_payload<S>(
&self,
__serializer: S,
__behavior: SkipSerialization,
) -> Result<S::Ok, S::Error>where
Self: Sized,
S: Serializer,
source§fn extract_child_meta(&self) -> MetaMapwhere
Self: Sized,
fn extract_child_meta(&self) -> MetaMapwhere
Self: Sized,
§fn extract_meta_tree(value: &Annotated<Self>) -> MetaTreewhere
Self: Sized,
fn extract_meta_tree(value: &Annotated<Self>) -> MetaTreewhere
Self: Sized,
source§impl PartialEq for DeviceContext
impl PartialEq for DeviceContext
source§impl ProcessValue for DeviceContext
impl ProcessValue for DeviceContext
source§fn value_type(&self) -> EnumSet<ValueType>
fn value_type(&self) -> EnumSet<ValueType>
source§fn process_value<P>(
&mut self,
__meta: &mut Meta,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
fn process_value<P>(
&mut self,
__meta: &mut Meta,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
source§fn process_child_values<P>(
&mut self,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
fn process_child_values<P>(
&mut self,
__processor: &mut P,
__state: &ProcessingState<'_>,
) -> ProcessingResultwhere
P: Processor,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)