pub enum EventPayload {
Vec3(Vec3F),
Quaternion(Vec4F),
UncalibratedVec3(UncalibratedVec3FSample),
Float(f32),
Integer(u64),
Pose(Pose),
// some variants omitted
}
Expand description
All of the potential data types a SensorEvent may carry depending on the sensor type.
Variants§
Vec3(Vec3F)
The following sensors emit basic 3D float vectors: ACCELEROMETER, MAGNETIC_FIELD, ORIENTATION, GYROSCOPE, GRAVITY, LINEAR_ACCELERATION.
Quaternion(Vec4F)
The following sensors emit floating point quaternions: ROTATION_VECTOR, GEOMAGNETIC_ROTATION_VECTOR, GAME_ROTATION_VECTOR.
UncalibratedVec3(UncalibratedVec3FSample)
The following sensors emit pairs of float vectors (see documentation for UncalibratedImuSample): MAGNETIC_FIELD_UNCALIBRATED, GYROSCOPE_UNCALIBRATED, ACCELEROMETER_UNCALIBRATED.
Float(f32)
The following sensors emit a single float: DEVICE_ORIENTATION, LIGHT, PRESSURE, TEMPERATURE, PROXIMITY, RELATIVE_HUMIDITY, AMBIENT_TEMPERATURE, SIGNIFICANT_MOTION, STEP_DETECTOR, TILT_DETECTOR, WAKE_GESTURE, GLANCE_GESTURE, PICK_UP_GESTURE, WRIST_TILT_GESTURE, STATIONARY_DETECT, MOTION_DETECT, HEART_BEAT, LOW_LATENCY_OFFBODY_DETECT, HEART_RATE.
Integer(u64)
The following senors emit an unsigned 64-bit integer: STEP_COUNTER
Pose(Pose)
The following sensor types emit a pose (see documentation for Pose): POSE_6DOF.
Implementations§
Source§impl EventPayload
impl EventPayload
pub fn ordinal(&self) -> u64
pub fn unknown_variant_for_testing() -> Self
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl Clone for EventPayload
impl Clone for EventPayload
Source§fn clone(&self) -> EventPayload
fn clone(&self) -> EventPayload
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for EventPayload
impl Debug for EventPayload
Source§impl<D: ResourceDialect> Decode<EventPayload, D> for EventPayload
impl<D: ResourceDialect> Decode<EventPayload, D> for EventPayload
Source§impl<D: ResourceDialect> Encode<EventPayload, D> for &EventPayload
impl<D: ResourceDialect> Encode<EventPayload, D> for &EventPayload
Source§impl PartialEq for EventPayload
impl PartialEq for EventPayload
Source§impl TypeMarker for EventPayload
impl TypeMarker for EventPayload
Source§type Owned = EventPayload
type Owned = EventPayload
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for EventPayload
impl ValueTypeMarker for EventPayload
Source§type Borrowed<'a> = &'a EventPayload
type Borrowed<'a> = &'a EventPayload
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more