#[repr(i32)]pub enum Unit {
Show 25 variants
Undefined = 0,
Length = 15,
Mm = 1,
M = 2,
Angle = 241,
Rad = 49,
Deg = 65,
Time = 242,
Nanosec = 18,
Microsec = 34,
Millisec = 50,
Sec = 66,
Weight = 243,
Gram = 19,
Kg = 35,
Velocity = 244,
MSec = 20,
RadSec = 36,
Acceleration = 245,
MSec2 = 21,
RadSec2 = 37,
Force = 246,
N = 22,
Nm = 38,
Percent = 23,
}
Expand description
Some SI units.
Variants§
Undefined = 0
Length = 15
Length mask 0xf
Mm = 1
millimeters 0x1
M = 2
meters 0x2
Angle = 241
Angle mask 0xf1
Rad = 49
radians 0x31
Deg = 65
degrees 0x41
Time = 242
Time mask 0xf2
Nanosec = 18
nanoseconds 0x12
Microsec = 34
microseconds 0x22
Millisec = 50
milliseconds 0x32
Sec = 66
seconds 0x42
Weight = 243
Weight mask 0xf3
Gram = 19
grams 0x13
Kg = 35
kilograms 0x23
Velocity = 244
Velocity mask 0xf4
MSec = 20
linear velocity, meters per second 0x14
RadSec = 36
angular velocity, radians per second 0x24
Acceleration = 245
Acceleration mask 0xf5
MSec2 = 21
linear acceleration meters per second^2 0x15
RadSec2 = 37
angular acceleration radians per second^2 0x25
Force = 246
Force mask 0xf6
N = 22
force, newtons 0x16
Nm = 38
torque, newton-metres 0x26
Percent = 23
percentages 0x17
Implementations§
Source§impl Unit
impl Unit
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.