pub struct Temperature { /* private fields */ }Expand description
Measure of thermal energy
Predefined units:
| Symbol | Name | Equivalents |
|---|---|---|
| K | Kelvin | 0 K = -273,25 °C = -459.67 °F |
| °C | Degree Celsius | 0 °C = 32 °F = 273,25 K |
| °F | Degree Fahrenheit | 0 °F ≅ -17.778 °C ≅ 255.372 K |
Temperature units are converted using the following formulas:
| from \ to | Kelvin | Celsius | Fahrenheit |
|---|---|---|---|
| Kelvin | - | [°C] = [K] - 273.15 | [°F] = [K] * 9/5 - 459.67 |
| Celsius | [K] = [°C] + 273.15 | - | [°F] = [°C] * 9/5 + 32 |
| Fahrenheit | [K] = ([°F] + 459.67) * 5/9 | [°C] = ([°F] - 32) * 5/9 | - |
Trait Implementations§
Source§impl Add for Temperature
impl Add for Temperature
Source§impl Clone for Temperature
impl Clone for Temperature
Source§fn clone(&self) -> Temperature
fn clone(&self) -> Temperature
Returns a duplicate 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 Temperature
impl Debug for Temperature
Source§impl Display for Temperature
impl Display for Temperature
Source§impl<PQ: Quantity> Div<Rate<Temperature, PQ>> for Temperature
impl<PQ: Quantity> Div<Rate<Temperature, PQ>> for Temperature
Source§impl Div<f64> for Temperature
impl Div<f64> for Temperature
Source§impl Div for Temperature
impl Div for Temperature
Source§impl<TQ: Quantity> Mul<Rate<TQ, Temperature>> for Temperature
impl<TQ: Quantity> Mul<Rate<TQ, Temperature>> for Temperature
Source§impl Mul<Temperature> for AmountT
impl Mul<Temperature> for AmountT
Source§type Output = Temperature
type Output = Temperature
The resulting type after applying the
* operator.Source§impl Mul<f64> for Temperature
impl Mul<f64> for Temperature
Source§impl Neg for Temperature
impl Neg for Temperature
Source§impl PartialEq for Temperature
impl PartialEq for Temperature
Source§impl PartialOrd for Temperature
impl PartialOrd for Temperature
Source§impl Quantity for Temperature
impl Quantity for Temperature
Source§type UnitType = TemperatureUnit
type UnitType = TemperatureUnit
Associated type of unit
Source§fn new(amount: AmountT, unit: Self::UnitType) -> Self
fn new(amount: AmountT, unit: Self::UnitType) -> Self
Returns a new instance of the type implementing
Quantity.Source§fn iter_units() -> impl Iterator<Item = Self::UnitType>
fn iter_units() -> impl Iterator<Item = Self::UnitType>
Returns an iterator over the variants of
Self::UnitType.Source§fn unit_from_symbol(symbol: &str) -> Option<Self::UnitType>
fn unit_from_symbol(symbol: &str) -> Option<Self::UnitType>
Returns
Some(unit) where unit.symbol() == symbol, or None if
there is no such unit.Source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
Return
true if self and other have the same unit and their
amounts are equal, otherwise false.Source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Returns the partial order of
selfs and others amounts, if both
have the same unit, otherwise None.Source§impl Sub for Temperature
impl Sub for Temperature
impl Copy for Temperature
impl Eq for Temperature
Auto Trait Implementations§
impl Freeze for Temperature
impl RefUnwindSafe for Temperature
impl Send for Temperature
impl Sync for Temperature
impl Unpin for Temperature
impl UnsafeUnpin for Temperature
impl UnwindSafe for Temperature
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