Struct uom::si::Quantity[][src]

pub struct Quantity<D: ?Sized, U: ?Sized, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V>, 
{ pub dimension: PhantomData<D>, pub units: PhantomData<U>, pub value: V, }

Property of a phenomenon, body or substance, where the property has a magnitude that can be expressed as a number and a reference.

The preferred method of creating a Quantity instance is to use the new constructor which is generic over the input unit and accepts the input value as it's only parameter.

// Create a length of 1 meter.
let L = Length::new::<meter>(1.0);

Quantity fields are public to allow for the creation of const values and instances of non-named Quantitys. This functionality will be deprecated and subsequently removed once the const fn feature is stabilized.

// Create a `const` length of 1 meter.
const L: Length = Length { dimension: PhantomData, units: PhantomData, value: 1.0, };
// Create a `const` area of 1 square meter explicitly without using the `Area` alias.
const A: Quantity<ISQ<P2, Z0, Z0, Z0, Z0, Z0, Z0>, SI<f32>, f32> =
    Quantity { dimension: PhantomData, units: PhantomData, value: 1.0, };

Using units for the wrong quantity will cause a compile error:

This example is not tested
// error[E0277]: the trait bound `second: length::Unit` is not satisfied
let l = Length::new::<second>(1.0);

Mixing quantities will also cause a compile error:

This example is not tested
// error[E0308]: mismatched types
let r = Length::new::<meter>(1.0) + Time::new::<second>(1.0);
This example is not tested
// error[E0308]: mismatched types
let v: Velocity = Length::new::<meter>(1.0) * Time::new::<second>(1.0);

Fields

Quantity dimension. See Dimension.

Quantity base units. See Units.

Quantity value stored in the base units for the quantity.

Methods

impl<D: ?Sized, U: ?Sized, V> Quantity<D, U, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V>, 
[src]

Returns true if this value is NAN and false otherwise.

Returns true if this value is positive infinity or negative infinity and false otherwise.

Returns true if this number is neither infinite nor NAN.

Returns true if the number is neither zero, infinite, subnormal, or NAN.

Returns the floating point category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead.

Takes the cubic root of a number.

let l: Length = Volume::new::<cubic_meter>(8.0).cbrt();

The input type must have dimensions divisible by three:

This example is not tested
// error[E0271]: type mismatch resolving ...
let r = Area::new::<square_meter>(8.0).cbrt();

Computes the absolute value of self. Returns NAN if the quantity is NAN.

Returns a quantity that represents the sign of self.

  • 1.0 of the base unit if the number is positive, +0.0, or INFINITY.
  • -1.0 of the base unit if the number is negative, -0.0, or NEG_INFINITY.
  • NAN if the number is NAN.

Returns true if self's sign bit is positive, including +0.0 and INFINITY.

Returns true if self's sign is negative, including -0.0 and NEG_INFINITY.

Fused multiply-add. Computes (self * a) + b with only one rounding error. This produces a more accurate result with better performance than a separate multiplication operation followed by an add.

Takes the reciprocal (inverse) of a number, 1/x.

let f: Frequency = Time::new::<second>(1.0).recip();

Raises a quantity to an integer power.

let a: Area = Length::new::<meter>(3.0).powi(::uom::typenum::P2::new());

Takes the square root of a number. Returns NAN if self is a negative number.

let l: Length = Area::new::<square_meter>(4.0).sqrt();

The input type must have dimensions divisible by two:

This example is not tested
// error[E0271]: type mismatch resolving ...
let r = Length::new::<meter>(4.0).sqrt();

Returns the maximum of the two quantities.

Returns the minimum of the two quantities.

Trait Implementations

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, usize>> for usize where
    D: Dimension,
    D::Kind: Mul,
    U: Units<usize>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, u8>> for u8 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<u8>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, u16>> for u16 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<u16>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, u32>> for u32 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<u32>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, u64>> for u64 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<u64>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, isize>> for isize where
    D: Dimension,
    D::Kind: Mul,
    U: Units<isize>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, i8>> for i8 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<i8>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, i16>> for i16 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<i16>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, i32>> for i32 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<i32>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, i64>> for i64 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<i64>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, BigInt>> for BigInt where
    D: Dimension,
    D::Kind: Mul,
    U: Units<BigInt>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, BigUint>> for BigUint where
    D: Dimension,
    D::Kind: Mul,
    U: Units<BigUint>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, Rational>> for Rational where
    D: Dimension,
    D::Kind: Mul,
    U: Units<Rational>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, Rational32>> for Rational32 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<Rational32>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, Rational64>> for Rational64 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<Rational64>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, BigRational>> for BigRational where
    D: Dimension,
    D::Kind: Mul,
    U: Units<BigRational>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, f32>> for f32 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<f32>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Mul<Quantity<D, U, f64>> for f64 where
    D: Dimension,
    D::Kind: Mul,
    U: Units<f64>,
    Z0: Add<D::L>,
    Z0: Add<D::M>,
    Z0: Add<D::T>,
    Z0: Add<D::I>,
    Z0: Add<D::Th>,
    Z0: Add<D::N>,
    Z0: Add<D::J>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, usize>> for usize where
    D: Dimension,
    D::Kind: Div,
    U: Units<usize>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, u8>> for u8 where
    D: Dimension,
    D::Kind: Div,
    U: Units<u8>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, u16>> for u16 where
    D: Dimension,
    D::Kind: Div,
    U: Units<u16>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, u32>> for u32 where
    D: Dimension,
    D::Kind: Div,
    U: Units<u32>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, u64>> for u64 where
    D: Dimension,
    D::Kind: Div,
    U: Units<u64>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, isize>> for isize where
    D: Dimension,
    D::Kind: Div,
    U: Units<isize>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, i8>> for i8 where
    D: Dimension,
    D::Kind: Div,
    U: Units<i8>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, i16>> for i16 where
    D: Dimension,
    D::Kind: Div,
    U: Units<i16>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, i32>> for i32 where
    D: Dimension,
    D::Kind: Div,
    U: Units<i32>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, i64>> for i64 where
    D: Dimension,
    D::Kind: Div,
    U: Units<i64>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, BigInt>> for BigInt where
    D: Dimension,
    D::Kind: Div,
    U: Units<BigInt>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, BigUint>> for BigUint where
    D: Dimension,
    D::Kind: Div,
    U: Units<BigUint>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, Rational>> for Rational where
    D: Dimension,
    D::Kind: Div,
    U: Units<Rational>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, Rational32>> for Rational32 where
    D: Dimension,
    D::Kind: Div,
    U: Units<Rational32>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, Rational64>> for Rational64 where
    D: Dimension,
    D::Kind: Div,
    U: Units<Rational64>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, BigRational>> for BigRational where
    D: Dimension,
    D::Kind: Div,
    U: Units<BigRational>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, f32>> for f32 where
    D: Dimension,
    D::Kind: Div,
    U: Units<f32>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized> Div<Quantity<D, U, f64>> for f64 where
    D: Dimension,
    D::Kind: Div,
    U: Units<f64>,
    Z0: Sub<D::L>,
    Z0: Sub<D::M>,
    Z0: Sub<D::T>,
    Z0: Sub<D::I>,
    Z0: Sub<D::Th>,
    Z0: Sub<D::N>,
    Z0: Sub<D::J>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, Ul: ?Sized, Ur: ?Sized, V> Add<Quantity<D, Ur, V>> for Quantity<D, Ul, V> where
    D: Dimension,
    D::Kind: Add,
    Ul: Units<V>,
    Ur: Units<V>,
    V: Num + Conversion<V>, 
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<D: ?Sized, Ul: ?Sized, Ur: ?Sized, V> AddAssign<Quantity<D, Ur, V>> for Quantity<D, Ul, V> where
    D: Dimension,
    D::Kind: AddAssign,
    Ul: Units<V>,
    Ur: Units<V>,
    V: Num + Conversion<V> + AddAssign<V>, 
[src]

Performs the += operation.

impl<Dl: ?Sized, Dr: ?Sized, Ul: ?Sized, Ur: ?Sized, V> Mul<Quantity<Dr, Ur, V>> for Quantity<Dl, Ul, V> where
    Dl: Dimension,
    Dl::L: Add<Dr::L>,
    Dl::M: Add<Dr::M>,
    Dl::T: Add<Dr::T>,
    Dl::I: Add<Dr::I>,
    Dl::Th: Add<Dr::Th>,
    Dl::N: Add<Dr::N>,
    Dl::J: Add<Dr::J>,
    Dl::Kind: Mul,
    Dr: Dimension,
    Dr::Kind: Mul,
    Ul: Units<V>,
    Ur: Units<V>,
    V: Num + Conversion<V> + Mul<V>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized, V> Mul<V> for Quantity<D, U, V> where
    D: Dimension,
    D::Kind: Mul,
    U: Units<V>,
    V: Num + Conversion<V>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<D: ?Sized, U: ?Sized, V> MulAssign<V> for Quantity<D, U, V> where
    D: Dimension,
    D::Kind: MulAssign,
    U: Units<V>,
    V: Num + Conversion<V> + MulAssign<V>, 
[src]

Performs the *= operation.

impl<D: ?Sized, Ul: ?Sized, Ur: ?Sized, V> Sub<Quantity<D, Ur, V>> for Quantity<D, Ul, V> where
    D: Dimension,
    D::Kind: Sub,
    Ul: Units<V>,
    Ur: Units<V>,
    V: Num + Conversion<V>, 
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<D: ?Sized, Ul: ?Sized, Ur: ?Sized, V> SubAssign<Quantity<D, Ur, V>> for Quantity<D, Ul, V> where
    D: Dimension,
    D::Kind: SubAssign,
    Ul: Units<V>,
    Ur: Units<V>,
    V: Num + Conversion<V> + SubAssign<V>, 
[src]

Performs the -= operation.

impl<Dl: ?Sized, Dr: ?Sized, Ul: ?Sized, Ur: ?Sized, V> Div<Quantity<Dr, Ur, V>> for Quantity<Dl, Ul, V> where
    Dl: Dimension,
    Dl::L: Sub<Dr::L>,
    Dl::M: Sub<Dr::M>,
    Dl::T: Sub<Dr::T>,
    Dl::I: Sub<Dr::I>,
    Dl::Th: Sub<Dr::Th>,
    Dl::N: Sub<Dr::N>,
    Dl::J: Sub<Dr::J>,
    Dl::Kind: Div,
    Dr: Dimension,
    Dr::Kind: Div,
    Ul: Units<V>,
    Ur: Units<V>,
    V: Num + Conversion<V> + Div<V>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized, V> Div<V> for Quantity<D, U, V> where
    D: Dimension,
    D::Kind: Div,
    U: Units<V>,
    V: Num + Conversion<V>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<D: ?Sized, U: ?Sized, V> DivAssign<V> for Quantity<D, U, V> where
    D: Dimension,
    D::Kind: DivAssign,
    U: Units<V>,
    V: Num + Conversion<V> + DivAssign<V>, 
[src]

Performs the /= operation.

impl<D: ?Sized, U: ?Sized, V> Clone for Quantity<D, U, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V> + Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<D: ?Sized, U: ?Sized, V> Copy for Quantity<D, U, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V> + Copy
[src]

impl<D: ?Sized, U: ?Sized, V> Debug for Quantity<D, U, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V> + Debug
[src]

Formats the value using the given formatter. Read more

impl<D: ?Sized, U: ?Sized, V> Default for Quantity<D, U, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V> + Default
[src]

Returns the "default value" for a type. Read more

impl<D: ?Sized, U: ?Sized, V> Eq for Quantity<D, U, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V> + Eq
[src]

impl<D: ?Sized, U: ?Sized, V> Hash for Quantity<D, U, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V> + Hash
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<D: ?Sized, U: ?Sized, V> Neg for Quantity<D, U, V> where
    D: Dimension,
    D::Kind: Neg,
    U: Units<V>,
    V: Signed + Conversion<V>, 
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl<D: ?Sized, U: ?Sized, V> Ord for Quantity<D, U, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V> + Ord
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl<D: ?Sized, Ul: ?Sized, Ur: ?Sized, V> PartialEq<Quantity<D, Ur, V>> for Quantity<D, Ul, V> where
    D: Dimension,
    Ul: Units<V>,
    Ur: Units<V>,
    V: Num + Conversion<V>, 
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<D: ?Sized, Ul: ?Sized, Ur: ?Sized, V> PartialOrd<Quantity<D, Ur, V>> for Quantity<D, Ul, V> where
    D: Dimension,
    Ul: Units<V>,
    Ur: Units<V>,
    V: Num + Conversion<V> + PartialOrd
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<D: ?Sized, Ul: ?Sized, Ur: ?Sized, V> Rem<Quantity<D, Ur, V>> for Quantity<D, Ul, V> where
    D: Dimension,
    D::Kind: Rem,
    Ul: Units<V>,
    Ur: Units<V>,
    V: Num + Conversion<V>, 
[src]

The resulting type after applying the % operator.

Performs the % operation.

impl<D: ?Sized, Ul: ?Sized, Ur: ?Sized, V> RemAssign<Quantity<D, Ur, V>> for Quantity<D, Ul, V> where
    D: Dimension,
    D::Kind: RemAssign,
    Ul: Units<V>,
    Ur: Units<V>,
    V: Num + Conversion<V> + RemAssign
[src]

Performs the %= operation.

impl<D: ?Sized, U: ?Sized, V> Saturating for Quantity<D, U, V> where
    D: Dimension,
    D::Kind: Saturating,
    U: Units<V>,
    V: Num + Conversion<V> + Saturating
[src]

Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing. Read more

Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing. Read more

impl<D: ?Sized, U: ?Sized, V> Sum for Quantity<D, U, V> where
    D: Dimension,
    D::Kind: Add,
    U: Units<V>,
    V: Num + Conversion<V> + Sum
[src]

Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more

impl<D: ?Sized, U: ?Sized, V> Zero for Quantity<D, U, V> where
    D: Dimension,
    D::Kind: Add,
    U: Units<V>,
    V: Num + Conversion<V>, 
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl<D: ?Sized, U: ?Sized, V> Serialize for Quantity<D, U, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V> + Serialize
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de, D: ?Sized, U: ?Sized, V> Deserialize<'de> for Quantity<D, U, V> where
    D: Dimension,
    U: Units<V>,
    V: Num + Conversion<V> + Deserialize<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

impl<D: ?Sized, U: ?Sized, V> Send for Quantity<D, U, V> where
    V: Send

impl<D: ?Sized, U: ?Sized, V> Sync for Quantity<D, U, V> where
    V: Sync