#[non_exhaustive]pub enum TemperatureUnits {
Kelvin,
Celsius,
Fahrenheit,
Rankine,
}
Expand description
Represents a specific temperature unit - SI or otherwise
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Kelvin
Referenced 0
is Absolute Zero and counts up at the same rate as TemperatureUnits::Celsius
. 0 Kelvin is
-273.15 Celsius, -459.67 Fahrenheit, and 0 Rankine
Celsius
Referenced such that 0
is the melting point of Ice, and 100
is the boiling point of water.
Increments at the same rate as Kelvin
as a constant offset. 0 Celsius is 273.15 Kelvin,
32 Fahrenheit, and 491.67 Rankine.
Fahrenheit
Freedom unit referenced such that 0
is the freezing point of a salty bath, and 100
is
the approximate value of a human body. 0 Fahrenheit is -17.78 Celsius, 255.37 Kelvin, and
459.67 Rankine
Rankine
Fahrenheit, except referenced to Absolute Zero. 0 Rankine is 0 Kelvin, -273.15 Celsius and -459.67 Fahrenheit.
Trait Implementations§
Source§impl Clone for TemperatureUnits
impl Clone for TemperatureUnits
Source§fn clone(&self) -> TemperatureUnits
fn clone(&self) -> TemperatureUnits
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TemperatureUnits
impl Debug for TemperatureUnits
Source§impl Default for TemperatureUnits
impl Default for TemperatureUnits
Source§fn default() -> TemperatureUnits
fn default() -> TemperatureUnits
Returns the “default value” for a type. Read more
Source§impl FromUnits<f32> for TemperatureUnits
impl FromUnits<f32> for TemperatureUnits
Source§impl FromUnits<f64> for TemperatureUnits
impl FromUnits<f64> for TemperatureUnits
Source§impl PartialEq for TemperatureUnits
impl PartialEq for TemperatureUnits
Source§impl Unit<TemperatureUnits> for &Temperature
impl Unit<TemperatureUnits> for &Temperature
type Output = Temperature
fn as_unit(&self, units: TemperatureUnits) -> Temperaturewhere
Self: Sized,
Source§impl Unit<TemperatureUnits> for &mut Temperature
impl Unit<TemperatureUnits> for &mut Temperature
type Output = Temperature
fn as_unit(&self, units: TemperatureUnits) -> Temperaturewhere
Self: Sized,
Source§impl Unit<TemperatureUnits> for Temperature
impl Unit<TemperatureUnits> for Temperature
type Output = Temperature
fn as_unit(&self, units: TemperatureUnits) -> Temperaturewhere
Self: Sized,
Source§impl UnitStruct<TemperatureUnits> for &Temperature
impl UnitStruct<TemperatureUnits> for &Temperature
type Output = Temperature
Source§fn new(value: f64, units: TemperatureUnits) -> Temperature
fn new(value: f64, units: TemperatureUnits) -> Temperature
Creates a new type
Source§fn units(&self) -> TemperatureUnits
fn units(&self) -> TemperatureUnits
Returns the unit type of this struct
Source§impl UnitStruct<TemperatureUnits> for &mut Temperature
impl UnitStruct<TemperatureUnits> for &mut Temperature
type Output = Temperature
Source§fn new(value: f64, units: TemperatureUnits) -> Temperature
fn new(value: f64, units: TemperatureUnits) -> Temperature
Creates a new type
Source§fn units(&self) -> TemperatureUnits
fn units(&self) -> TemperatureUnits
Returns the unit type of this struct
Source§impl UnitStruct<TemperatureUnits> for Temperature
impl UnitStruct<TemperatureUnits> for Temperature
type Output = Temperature
Source§fn new(value: f64, units: TemperatureUnits) -> Temperature
fn new(value: f64, units: TemperatureUnits) -> Temperature
Creates a new type
Source§fn units(&self) -> TemperatureUnits
fn units(&self) -> TemperatureUnits
Returns the unit type of this struct
impl Copy for TemperatureUnits
impl Eq for TemperatureUnits
impl StructuralPartialEq for TemperatureUnits
Auto Trait Implementations§
impl Freeze for TemperatureUnits
impl RefUnwindSafe for TemperatureUnits
impl Send for TemperatureUnits
impl Sync for TemperatureUnits
impl Unpin for TemperatureUnits
impl UnwindSafe for TemperatureUnits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more