relay_event_schema::protocol

Struct 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

source§

fn clone(&self) -> DeviceContext

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for DeviceContext

source§

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

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

impl Default for DeviceContext

source§

fn default() -> DeviceContext

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

impl DefaultContext for DeviceContext

source§

fn default_key() -> &'static str

The default key at which this context resides in Contexts.
source§

fn from_context(context: Context) -> Option<Self>

Converts this context type from a generic context type. Read more
source§

fn cast(context: &Context) -> Option<&Self>

Casts a reference to this context type from a generic context type. Read more
source§

fn cast_mut(context: &mut Context) -> Option<&mut Self>

Casts a mutable reference to this context type from a generic context type. Read more
source§

fn into_context(self) -> Context

Boxes this context type in the generic context wrapper. Read more
source§

impl Empty for DeviceContext

source§

fn is_empty(&self) -> bool

Returns whether this value is empty.
source§

fn is_deep_empty(&self) -> bool

Returns whether this value is empty or all of its descendants are empty. Read more
source§

impl FromValue for DeviceContext

source§

fn from_value(__value: Annotated<Value>) -> Annotated<Self>

Creates a meta structure from an annotated boxed value.
source§

impl IntoValue for DeviceContext

source§

fn into_value(self) -> Value

Boxes the meta structure back into a value.
source§

fn serialize_payload<S>( &self, __serializer: S, __behavior: SkipSerialization, ) -> Result<S::Ok, S::Error>
where Self: Sized, S: Serializer,

Efficiently serializes the payload directly.
source§

fn extract_child_meta(&self) -> MetaMap
where Self: Sized,

Extracts children meta map out of a value.
§

fn extract_meta_tree(value: &Annotated<Self>) -> MetaTree
where Self: Sized,

Extracts the meta tree out of annotated value. Read more
source§

impl PartialEq for DeviceContext

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ProcessValue for DeviceContext

source§

fn value_type(&self) -> EnumSet<ValueType>

Returns the type of the value.
source§

fn process_value<P>( &mut self, __meta: &mut Meta, __processor: &mut P, __state: &ProcessingState<'_>, ) -> ProcessingResult
where P: Processor,

Executes a processor on this value.
source§

fn process_child_values<P>( &mut self, __processor: &mut P, __state: &ProcessingState<'_>, ) -> ProcessingResult
where P: Processor,

Recurses into children of this value.
source§

impl StructuralPartialEq for DeviceContext

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T