pub enum UnitType {
Show 13 variants
None,
Other,
Meters,
Grams,
Degrees,
EnglishAngularVelocity,
SiLinearVelocity,
SiLinearAcceleration,
Webers,
Candelas,
Pascals,
Lux,
Seconds,
// some variants omitted
}
Expand description
This provides an easy, standardized way to specify units. New units can be added as needed. Each UnitType should be named after a specific unit that should be fully distinguished by the name (E.g: Use METERS instead of DISTANCE). More complicated units that need to be differentiated should begin with SI_ (for Internation System of Units) or ENGLISH_ (for English System of Units).
Variants§
None
The device did not specify units.
Other
The device specified units that are not convertible to any of the other units.
Meters
A measurement of distance in meters.
Grams
A measurement of mass in grams.
Degrees
A measurement of rotation in degrees.
EnglishAngularVelocity
A measurement of angular velocity in degrees per second.
SiLinearVelocity
A measurement of linear velocity in meters per second.
SiLinearAcceleration
A measurement of acceleration in meters per second squared.
Webers
A measure of magnetic flux in webers.
Candelas
A measurement of luminous intensity in candelas.
Pascals
A measurement of pressure in pascals.
Lux
Seconds
Implementations§
Source§impl UnitType
impl UnitType
pub fn from_primitive(prim: u32) -> Option<Self>
pub fn from_primitive_allow_unknown(prim: u32) -> Self
pub fn unknown() -> Self
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl<D: ResourceDialect> Decode<UnitType, D> for UnitType
impl<D: ResourceDialect> Decode<UnitType, D> for UnitType
Source§impl Ord for UnitType
impl Ord for UnitType
Source§impl PartialOrd for UnitType
impl PartialOrd for UnitType
Source§impl TypeMarker for UnitType
impl TypeMarker for UnitType
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
.Source§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 moreSource§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.