pub type ThermodynamicTemperature<U, V> = Quantity<Dimension, U, V>;
Expand description

Thermodynamic temperature (base unit kelvin, K).

§Generic Parameters

  • U: Base units.
  • V: Underlying storage type.

Aliased Type§

struct ThermodynamicTemperature<U, V> {
    pub dimension: PhantomData<dyn Dimension<M = Z0, N = Z0, Th = PInt<UInt<UTerm, B1>>, Kind = dyn TemperatureKind, J = Z0, I = Z0, L = Z0, T = Z0>>,
    pub units: PhantomData<U>,
    pub value: V,
}

Fields§

§dimension: PhantomData<dyn Dimension<M = Z0, N = Z0, Th = PInt<UInt<UTerm, B1>>, Kind = dyn TemperatureKind, J = Z0, I = Z0, L = Z0, T = Z0>>

Quantity dimension. See Dimension.

§units: PhantomData<U>

Quantity base units. See Units.

§value: V

Quantity value stored in the base units for the quantity.

Implementations§

source§

impl<U, V> ThermodynamicTemperature<U, V>
where U: Units<V> + ?Sized, V: Num + Conversion<V>,

source

pub fn new<N>(v: V) -> Self
where N: Unit + Conversion<V, T = V::T>,

Create a new quantity from the given value and measurement unit.

§Generic Parameters
  • N: Unit.
source

pub fn get<N>(&self) -> V
where N: Unit + Conversion<V, T = V::T>,

Retrieve the value of the quantity in the given measurement unit.

§Generic Parameters
  • N: Unit.
source

pub fn floor<N>(self) -> Self
where V: Float, N: Unit + Conversion<V, T = V::T>,

Returns the largest integer less than or equal to a number in the given measurement unit.

§Generic Parameters
  • N: Unit.
source

pub fn ceil<N>(self) -> Self
where V: Float, N: Unit + Conversion<V, T = V::T>,

Returns the smallest integer less than or equal to a number in the given measurement unit.

§Generic Parameters
  • N: Unit.
source

pub fn round<N>(self) -> Self
where V: Float, N: Unit + Conversion<V, T = V::T>,

Returns the nearest integer to a number in the in given measurement unit. Round half-way cases away from 0.0.

§Generic Parameters
  • N: Unit.
source

pub fn trunc<N>(self) -> Self
where V: Float, N: Unit + Conversion<V, T = V::T>,

Returns the integer part of a number in the given measurement unit.

§Generic Parameters
  • N: Unit.
source

pub fn fract<N>(self) -> Self
where V: Float, N: Unit + Conversion<V, T = V::T>,

Returns the fractional part of a number in the given measurement unit.

§Generic Parameters
  • N: Unit.
source

pub fn format_args<N>(_unit: N, style: DisplayStyle) -> Arguments<Dimension, N>
where N: Unit,

Creates a struct that can be used to format a compatible quantity for display.

§Notes

The return value of this method cannot be used to print directly, but is instead used to format quantities and can be reused; see Arguments::with and the examples below.

If you do not need to format multiple quantities, consider using into_format_args instead.

§Examples
let t1 = Time::new::<femtosecond>(1.0_E-1);
let t2 = Time::new::<picosecond>(1.0_E-1);
let a = Time::format_args(femtosecond, Description);

assert_eq!("0.1 femtoseconds", format!("{}", a.with(t1)));
assert_eq!("100 femtoseconds", format!("{}", a.with(t2)));
§Generic Parameters
  • N: Unit.
source

pub fn into_format_args<N>( self, _unit: N, style: DisplayStyle ) -> QuantityArguments<Dimension, U, V, N>
where N: Unit,

Creates a struct that formats self for display.

§Notes

Unlike format_args, the return value of this method can be used directly for display. It will format the value of self for the quantity on which it is called and nothing else.

If you wish to reuse the return value to format multiple quantities, use format_args instead.

§Examples
let t = Time::new::<picosecond>(1.0_E-1);
let a = t.into_format_args(femtosecond, Description);

assert_eq!("100 femtoseconds", format!("{}", a));
§Generic Parameters
  • N: Unit.

Trait Implementations§

source§

impl<Ul, Ur, V> Add<Quantity<dyn Dimension<M = Z0, N = Z0, Th = PInt<UInt<UTerm, B1>>, Kind = dyn Kind, J = Z0, I = Z0, L = Z0, T = Z0>, Ur, V>> for ThermodynamicTemperature<Ul, V>
where Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

§

type Output = Quantity<dyn Dimension<M = Z0, N = Z0, Th = PInt<UInt<UTerm, B1>>, Kind = dyn TemperatureKind, J = Z0, I = Z0, L = Z0, T = Z0>, Ul, V>

The resulting type after applying the + operator.
source§

fn add(self, rhs: TemperatureInterval<Ur, V>) -> Self::Output

Performs the + operation. Read more
source§

impl<Ul, Ur, V> AddAssign<Quantity<dyn Dimension<M = Z0, N = Z0, Th = PInt<UInt<UTerm, B1>>, Kind = dyn Kind, J = Z0, I = Z0, L = Z0, T = Z0>, Ur, V>> for ThermodynamicTemperature<Ul, V>
where Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V> + AddAssign<V>,

source§

fn add_assign(&mut self, rhs: TemperatureInterval<Ur, V>)

Performs the += operation. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, BigInt>
where U: Units<BigInt> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, BigUint>
where U: Units<BigUint> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, BigRational>
where U: Units<BigRational> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, Rational32>
where U: Units<Rational32> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, Rational64>
where U: Units<Rational64> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, Rational>
where U: Units<Rational> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, f32>
where U: Units<f32> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, f64>
where U: Units<f64> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, i32>
where U: Units<i32> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, i64>
where U: Units<i64> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, isize>
where U: Units<isize> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, u32>
where U: Units<u32> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, u64>
where U: Units<u64> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<U> FromStr for ThermodynamicTemperature<U, usize>
where U: Units<usize> + ?Sized,

§

type Err = ParseQuantityError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<Ul, Ur, V> Sub<Quantity<dyn Dimension<M = Z0, N = Z0, Th = PInt<UInt<UTerm, B1>>, Kind = dyn Kind, J = Z0, I = Z0, L = Z0, T = Z0>, Ur, V>> for ThermodynamicTemperature<Ul, V>
where Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

§

type Output = Quantity<dyn Dimension<M = Z0, N = Z0, Th = PInt<UInt<UTerm, B1>>, Kind = dyn TemperatureKind, J = Z0, I = Z0, L = Z0, T = Z0>, Ul, V>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: TemperatureInterval<Ur, V>) -> Self::Output

Performs the - operation. Read more
source§

impl<Ul, Ur, V> SubAssign<Quantity<dyn Dimension<M = Z0, N = Z0, Th = PInt<UInt<UTerm, B1>>, Kind = dyn Kind, J = Z0, I = Z0, L = Z0, T = Z0>, Ur, V>> for ThermodynamicTemperature<Ul, V>
where Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V> + SubAssign<V>,

source§

fn sub_assign(&mut self, rhs: TemperatureInterval<Ur, V>)

Performs the -= operation. Read more