pub enum Unit {
Smidge,
Millikelvin,
Kelvin,
ThousandthRankine,
Rankine,
Celsius,
Fahrenheit,
}Expand description
Unit type for parsing.
These are distinct from the constants in joto_constants in the sense that they
are meant to represent parsing/generating behavior, and not numeric behavior.
Variants§
Smidge
Smidge ― 1⁄90 mK.
Millikelvin
Millikelvin.
Kelvin
Kelvin ― absolute scale of Celsius.
ThousandthRankine
Thousandth rankine ― 0.001 °R.
Rankine
Rankine ― absolute scale of Fahrenheit.
Celsius
Celsius ― relative scale based on Kelvin, with origin at ZERO_CELSIUS.
Parsed values are absolute temperatures: t°C = ZERO_CELSIUS + t × KELVIN.
Fahrenheit
Fahrenheit ― relative scale based on Rankine, with origin at ZERO_FAHRENHEIT.
Parsed values are absolute temperatures: t°F = ZERO_FAHRENHEIT + t × RANKINE.
Implementations§
Source§impl Unit
impl Unit
Sourcepub const fn ascii_abbr(self) -> &'static [u8]
pub const fn ascii_abbr(self) -> &'static [u8]
Canonical ASCII abbreviation for the unit.
Sourcepub const fn max_decimal_digits(self) -> u8
pub const fn max_decimal_digits(self) -> u8
Maximum number of decimal fraction digits that are exactly represented in smidge.
Sourcepub const fn origin_offset(self) -> u32
pub const fn origin_offset(self) -> u32
Unit origin offset in smidge.
Sourcepub const fn least_significant_digit_value(self) -> u32
pub const fn least_significant_digit_value(self) -> u32
The base to use when parsing the least significant safe decimal digit.