Struct measurements::Temperature
[−]
[src]
pub struct Temperature { /* fields omitted */ }
The Temperature
struct can be used to deal with temperatures in a common way.
Example
use measurements::Temperature; let boiling_water = Temperature::from_celsius(100.0); let fahrenheit = boiling_water.as_fahrenheit(); println!("Boiling water measures at {} degrees fahrenheit.", fahrenheit);
Methods
impl Temperature
[src]
fn from_kelvin(degrees_kelvin: f64) -> Self
fn from_celsius(degrees_celsius: f64) -> Self
fn from_fahrenheit(degrees_fahrenheit: f64) -> Self
fn from_rankine(degrees_rankine: f64) -> Self
fn as_kelvin(&self) -> f64
fn as_celsius(&self) -> f64
fn as_fahrenheit(&self) -> f64
fn as_rankine(&self) -> f64
Trait Implementations
impl Copy for Temperature
[src]
impl Clone for Temperature
[src]
fn clone(&self) -> Temperature
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Temperature
[src]
impl Measurement for Temperature
[src]
fn get_base_units(&self) -> f64
fn from_base_units(degrees_kelvin: f64) -> Self
impl Add<TemperatureDelta> for Temperature
[src]
type Output = Temperature
The resulting type after applying the +
operator
fn add(self, other: TemperatureDelta) -> Temperature
The method for the +
operator
impl Sub<TemperatureDelta> for Temperature
[src]
type Output = Temperature
The resulting type after applying the -
operator
fn sub(self, other: TemperatureDelta) -> Temperature
The method for the -
operator
impl Sub<Temperature> for Temperature
[src]
type Output = TemperatureDelta
The resulting type after applying the -
operator
fn sub(self, other: Temperature) -> TemperatureDelta
The method for the -
operator
impl Eq for Temperature
[src]
impl PartialEq for Temperature
[src]
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl PartialOrd for Temperature
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more