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§
Trait Implementations§
Source§impl<D> Decode<UnitType, D> for UnitTypewhere
D: ResourceDialect,
impl<D> Decode<UnitType, D> for UnitTypewhere
D: ResourceDialect,
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.Source§impl ValueTypeMarker for UnitType
impl ValueTypeMarker for UnitType
Source§type Borrowed<'a> = UnitType
type Borrowed<'a> = UnitType
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreSource§fn borrow(
value: &<UnitType as TypeMarker>::Owned,
) -> <UnitType as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<UnitType as TypeMarker>::Owned, ) -> <UnitType as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.