[−][src]Struct mag::Temperature
A measurement of thermodynamic temperature.
Temperature is a base quantity with a specific unit.
Operations
- Temperature
+
Temperature=>
Temperature - Temperature
-
Temperature=>
Temperature - f64
*
unit=>
Temperature
Units must be the same for operations with two Temperature operands. The to method can be used for conversion.
use mag::temp::{DegC, DegF}; let a = 72.5 * DegF; let b = 100.0 * DegC; assert_eq!(a.to_string(), "72.5 °F"); assert_eq!(b.to_string(), "100 °C");
Fields
quantity: f64
Temperature quantity
Methods
impl<U> Temperature<U> where
U: Unit,
[src]
U: Unit,
pub fn new(quantity: f64) -> Self
[src]
Create a new temperature measurement
pub fn to<T: Unit>(self) -> Temperature<T>
[src]
Convert to specified units
Trait Implementations
impl<U: Clone> Clone for Temperature<U> where
U: Unit,
[src]
U: Unit,
fn clone(&self) -> Temperature<U>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<U: Copy> Copy for Temperature<U> where
U: Unit,
[src]
U: Unit,
impl<U: PartialEq> PartialEq<Temperature<U>> for Temperature<U> where
U: Unit,
[src]
U: Unit,
fn eq(&self, other: &Temperature<U>) -> bool
[src]
fn ne(&self, other: &Temperature<U>) -> bool
[src]
impl<U> Display for Temperature<U> where
U: Unit,
[src]
U: Unit,
impl<U: Debug> Debug for Temperature<U> where
U: Unit,
[src]
U: Unit,
impl<U> Sub<Temperature<U>> for Temperature<U> where
U: Unit,
[src]
U: Unit,
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
impl<U> Add<Temperature<U>> for Temperature<U> where
U: Unit,
[src]
U: Unit,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self::Output
[src]
impl<U> StructuralPartialEq for Temperature<U> where
U: Unit,
[src]
U: Unit,
Auto Trait Implementations
impl<U> Send for Temperature<U> where
U: Send,
U: Send,
impl<U> Sync for Temperature<U> where
U: Sync,
U: Sync,
impl<U> Unpin for Temperature<U> where
U: Unpin,
U: Unpin,
impl<U> UnwindSafe for Temperature<U> where
U: UnwindSafe,
U: UnwindSafe,
impl<U> RefUnwindSafe for Temperature<U> where
U: RefUnwindSafe,
U: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,