Struct uom::si::Quantity

source ·
#[repr(transparent)]
pub struct Quantity<D, U, V>
where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V>,
{ pub dimension: PhantomData<D>, pub units: PhantomData<U>, pub value: V, }
Expand description

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:

// 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:

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

§Generic Parameters

  • D: Quantity dimension. See Dimension.
  • U: Quantity base units. See Units.
  • V: Quantity value underlying storage type.

Fields§

§dimension: PhantomData<D>

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> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = Z0, N = PInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn AngleKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn AngleKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn AngleKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn AngleKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn AngleKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>, T = PInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = NInt<UInt<UTerm, B1>>, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = Z0, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = PInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>, Th = Z0, I = PInt<UInt<UInt<UTerm, B1>, B0>>, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = PInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B1>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = PInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn AngleKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B1>>, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = Z0, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = NInt<UInt<UTerm, B1>>, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = NInt<UInt<UTerm, B1>>, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B1>>, T = PInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>, Th = Z0, I = PInt<UInt<UInt<UTerm, B1>, B0>>, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = NInt<UInt<UTerm, B1>>, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = PInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = PInt<UInt<UInt<UTerm, B1>, B0>>, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B1>>, T = PInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = PInt<UInt<UInt<UTerm, B1>, B0>>, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = PInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = NInt<UInt<UInt<UTerm, B1>, B0>>, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = NInt<UInt<UInt<UTerm, B1>, B0>>, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = NInt<UInt<UTerm, B1>>, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = NInt<UInt<UTerm, B1>>, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = NInt<UInt<UInt<UTerm, B1>, B0>>, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn InformationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn InformationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B1>>, T = PInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = Z0, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = PInt<UInt<UTerm, B1>>, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = PInt<UInt<UTerm, B1>>, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = Z0, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = NInt<UInt<UTerm, B1>>, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = NInt<UInt<UTerm, B1>>, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = Z0, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = NInt<UInt<UInt<UTerm, B1>, B0>>, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B1>>, T = Z0, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B1>>, T = Z0, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = PInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = NInt<UInt<UTerm, B1>>, N = PInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B1>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = PInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = NInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = PInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = NInt<UInt<UTerm, B1>>, I = Z0, M = PInt<UInt<UTerm, B1>>, N = NInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = NInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = NInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B1>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = NInt<UInt<UTerm, B1>>, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = Z0, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn SolidAngleKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = Z0, Th = Z0, I = Z0, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = NInt<UInt<UTerm, B1>>, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B1>>, T = Z0, Th = Z0, I = Z0, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = Z0, Th = Z0, I = PInt<UInt<UTerm, B1>>, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = NInt<UInt<UTerm, B1>>, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = Z0, Th = PInt<UInt<UTerm, B1>>, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = PInt<UInt<UTerm, B1>>, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = NInt<UInt<UTerm, B1>>, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = NInt<UInt<UTerm, B1>>, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B0>>, T = PInt<UInt<UInt<UTerm, B1>, B1>>, Th = PInt<UInt<UTerm, B1>>, I = Z0, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = Z0, Th = PInt<UInt<UTerm, B1>>, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn TemperatureKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = Z0, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B0>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn AngleKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UTerm, B1>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B1>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = PInt<UInt<UInt<UTerm, B1>, B1>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>>, T = PInt<UInt<UInt<UTerm, B1>, B0>>, Th = Z0, I = Z0, M = NInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B0>>, Th = NInt<UInt<UTerm, B1>>, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B1>>, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UInt<UTerm, B1>, B1>>, T = NInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn ConstituentConcentrationKind>, 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.
source§

impl<U, V> Quantity<dyn Dimension<L = NInt<UInt<UTerm, B1>>, T = NInt<UInt<UInt<UTerm, B1>, B1>>, Th = Z0, I = Z0, M = PInt<UInt<UTerm, B1>>, N = Z0, J = Z0, Kind = dyn Kind>, 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.
source§

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

source

pub fn classify(self) -> FpCategory
where V: Float,

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.

source

pub fn abs(self) -> Self
where V: Signed,

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

source

pub fn signum(self) -> Self
where V: Signed,

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.
source

pub fn is_sign_positive(self) -> bool
where V: Float,

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

source

pub fn is_sign_negative(self) -> bool
where V: Float,

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

source

pub fn recip( self ) -> Quantity<ISQ<Negate<D::L>, Negate<D::M>, Negate<D::T>, Negate<D::I>, Negate<D::Th>, Negate<D::N>, Negate<D::J>>, U, V>
where D::L: Neg, <D::L as Neg>::Output: Integer, D::M: Neg, <D::M as Neg>::Output: Integer, D::T: Neg, <D::T as Neg>::Output: Integer, D::I: Neg, <D::I as Neg>::Output: Integer, D::Th: Neg, <D::Th as Neg>::Output: Integer, D::N: Neg, <D::N as Neg>::Output: Integer, D::J: Neg, <D::J as Neg>::Output: Integer, D::Kind: Div, V: Float,

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

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

pub fn max(self, other: Self) -> Self
where V: Float,

Returns the maximum of the two quantities.

source

pub fn min(self, other: Self) -> Self
where V: Float,

Returns the minimum of the two quantities.

Trait Implementations§

source§

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

§

type Output = Quantity<D, Ul, V>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

§

type Output = Quantity<dyn Dimension<L = Z0, T = Z0, Th = PInt<UInt<UTerm, B1>>, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn TemperatureKind>, 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> Add<Quantity<dyn Dimension<L = Z0, T = Z0, Th = PInt<UInt<UTerm, B1>>, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn TemperatureKind>, Ur, V>> for TemperatureInterval<Ul, V>
where Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

§

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

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

source§

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

Performs the += operation. Read more
source§

impl<Ul, Ur, V> AddAssign<Quantity<dyn Dimension<L = Z0, T = Z0, Th = PInt<UInt<UTerm, B1>>, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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<D, U, V> Clone for Quantity<D, U, V>
where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<D, U, V> ConstZero for Quantity<D, U, V>
where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + ConstZero,

source§

const ZERO: Self = _

Constant representing the zero value.
source§

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<D, U> Div<Quantity<D, U, u16>> for u16
where D: Dimension + ?Sized, D::Kind: Div, U: Units<u16> + ?Sized, Z0: Sub<D::L> + Sub<D::M> + Sub<D::T> + Sub<D::I> + Sub<D::Th> + Sub<D::N> + Sub<D::J>, <Z0 as Sub<D::L>>::Output: Integer, <Z0 as Sub<D::M>>::Output: Integer, <Z0 as Sub<D::T>>::Output: Integer, <Z0 as Sub<D::I>>::Output: Integer, <Z0 as Sub<D::Th>>::Output: Integer, <Z0 as Sub<D::N>>::Output: Integer, <Z0 as Sub<D::J>>::Output: Integer,

§

type Output = Quantity<dyn Dimension<L = <Z0 as Sub<<D as Dimension>::L>>::Output, T = <Z0 as Sub<<D as Dimension>::T>>::Output, Th = <Z0 as Sub<<D as Dimension>::Th>>::Output, I = <Z0 as Sub<<D as Dimension>::I>>::Output, M = <Z0 as Sub<<D as Dimension>::M>>::Output, N = <Z0 as Sub<<D as Dimension>::N>>::Output, J = <Z0 as Sub<<D as Dimension>::J>>::Output, Kind = <D as Dimension>::Kind>, U, u16>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Quantity<D, U, u16>) -> Self::Output

Performs the / operation. Read more
source§

impl<D, U> Div<Quantity<D, U, u32>> for u32
where D: Dimension + ?Sized, D::Kind: Div, U: Units<u32> + ?Sized, Z0: Sub<D::L> + Sub<D::M> + Sub<D::T> + Sub<D::I> + Sub<D::Th> + Sub<D::N> + Sub<D::J>, <Z0 as Sub<D::L>>::Output: Integer, <Z0 as Sub<D::M>>::Output: Integer, <Z0 as Sub<D::T>>::Output: Integer, <Z0 as Sub<D::I>>::Output: Integer, <Z0 as Sub<D::Th>>::Output: Integer, <Z0 as Sub<D::N>>::Output: Integer, <Z0 as Sub<D::J>>::Output: Integer,

§

type Output = Quantity<dyn Dimension<L = <Z0 as Sub<<D as Dimension>::L>>::Output, T = <Z0 as Sub<<D as Dimension>::T>>::Output, Th = <Z0 as Sub<<D as Dimension>::Th>>::Output, I = <Z0 as Sub<<D as Dimension>::I>>::Output, M = <Z0 as Sub<<D as Dimension>::M>>::Output, N = <Z0 as Sub<<D as Dimension>::N>>::Output, J = <Z0 as Sub<<D as Dimension>::J>>::Output, Kind = <D as Dimension>::Kind>, U, u32>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Quantity<D, U, u32>) -> Self::Output

Performs the / operation. Read more
source§

impl<D, U> Div<Quantity<D, U, u8>> for u8
where D: Dimension + ?Sized, D::Kind: Div, U: Units<u8> + ?Sized, Z0: Sub<D::L> + Sub<D::M> + Sub<D::T> + Sub<D::I> + Sub<D::Th> + Sub<D::N> + Sub<D::J>, <Z0 as Sub<D::L>>::Output: Integer, <Z0 as Sub<D::M>>::Output: Integer, <Z0 as Sub<D::T>>::Output: Integer, <Z0 as Sub<D::I>>::Output: Integer, <Z0 as Sub<D::Th>>::Output: Integer, <Z0 as Sub<D::N>>::Output: Integer, <Z0 as Sub<D::J>>::Output: Integer,

§

type Output = Quantity<dyn Dimension<L = <Z0 as Sub<<D as Dimension>::L>>::Output, T = <Z0 as Sub<<D as Dimension>::T>>::Output, Th = <Z0 as Sub<<D as Dimension>::Th>>::Output, I = <Z0 as Sub<<D as Dimension>::I>>::Output, M = <Z0 as Sub<<D as Dimension>::M>>::Output, N = <Z0 as Sub<<D as Dimension>::N>>::Output, J = <Z0 as Sub<<D as Dimension>::J>>::Output, Kind = <D as Dimension>::Kind>, U, u8>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Quantity<D, U, u8>) -> Self::Output

Performs the / operation. Read more
source§

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

§

type Output = Quantity<dyn Dimension<L = <<Dl as Dimension>::L as Sub<<Dr as Dimension>::L>>::Output, T = <<Dl as Dimension>::T as Sub<<Dr as Dimension>::T>>::Output, Th = <<Dl as Dimension>::Th as Sub<<Dr as Dimension>::Th>>::Output, I = <<Dl as Dimension>::I as Sub<<Dr as Dimension>::I>>::Output, M = <<Dl as Dimension>::M as Sub<<Dr as Dimension>::M>>::Output, N = <<Dl as Dimension>::N as Sub<<Dr as Dimension>::N>>::Output, J = <<Dl as Dimension>::J as Sub<<Dr as Dimension>::J>>::Output, Kind = dyn Kind>, Ul, V>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Quantity<Dr, Ur, V>) -> Self::Output

Performs the / operation. Read more
source§

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

§

type Output = Quantity<D, U, V>

The resulting type after applying the / operator.
source§

fn div(self, rhs: V) -> Self::Output

Performs the / operation. Read more
source§

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

source§

fn div_assign(&mut self, rhs: V)

Performs the /= operation. Read more
source§

impl<L, M, T, I, Th, N, J, Ul, Ur, V> From<Quantity<dyn Dimension<L = L, T = T, Th = Th, I = I, M = M, N = N, J = J, Kind = dyn AngleKind>, Ur, V>> for Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ul, V>
where L: Integer, M: Integer, T: Integer, I: Integer, Th: Integer, N: Integer, J: Integer, Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

source§

fn from( val: Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn AngleKind>, Ur, V> ) -> Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ul, V>

Converts to this type from the input type.
source§

impl<L, M, T, I, Th, N, J, Ul, Ur, V> From<Quantity<dyn Dimension<L = L, T = T, Th = Th, I = I, M = M, N = N, J = J, Kind = dyn ConstituentConcentrationKind>, Ur, V>> for Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ul, V>
where L: Integer, M: Integer, T: Integer, I: Integer, Th: Integer, N: Integer, J: Integer, Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

source§

fn from( val: Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn ConstituentConcentrationKind>, Ur, V> ) -> Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ul, V>

Converts to this type from the input type.
source§

impl<L, M, T, I, Th, N, J, Ul, Ur, V> From<Quantity<dyn Dimension<L = L, T = T, Th = Th, I = I, M = M, N = N, J = J, Kind = dyn InformationKind>, Ur, V>> for Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ul, V>
where L: Integer, M: Integer, T: Integer, I: Integer, Th: Integer, N: Integer, J: Integer, Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

source§

fn from( val: Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn InformationKind>, Ur, V> ) -> Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ul, V>

Converts to this type from the input type.
source§

impl<L, M, T, I, Th, N, J, Ul, Ur, V> From<Quantity<dyn Dimension<L = L, T = T, Th = Th, I = I, M = M, N = N, J = J, Kind = dyn Kind>, Ur, V>> for Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn AngleKind>, Ul, V>
where L: Integer, M: Integer, T: Integer, I: Integer, Th: Integer, N: Integer, J: Integer, Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

source§

fn from( val: Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ur, V> ) -> Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn AngleKind>, Ul, V>

Converts to this type from the input type.
source§

impl<L, M, T, I, Th, N, J, Ul, Ur, V> From<Quantity<dyn Dimension<L = L, T = T, Th = Th, I = I, M = M, N = N, J = J, Kind = dyn Kind>, Ur, V>> for Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn ConstituentConcentrationKind>, Ul, V>
where L: Integer, M: Integer, T: Integer, I: Integer, Th: Integer, N: Integer, J: Integer, Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

source§

fn from( val: Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ur, V> ) -> Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn ConstituentConcentrationKind>, Ul, V>

Converts to this type from the input type.
source§

impl<L, M, T, I, Th, N, J, Ul, Ur, V> From<Quantity<dyn Dimension<L = L, T = T, Th = Th, I = I, M = M, N = N, J = J, Kind = dyn Kind>, Ur, V>> for Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn InformationKind>, Ul, V>
where L: Integer, M: Integer, T: Integer, I: Integer, Th: Integer, N: Integer, J: Integer, Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

source§

fn from( val: Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ur, V> ) -> Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn InformationKind>, Ul, V>

Converts to this type from the input type.
source§

impl<L, M, T, I, Th, N, J, Ul, Ur, V> From<Quantity<dyn Dimension<L = L, T = T, Th = Th, I = I, M = M, N = N, J = J, Kind = dyn Kind>, Ur, V>> for Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn SolidAngleKind>, Ul, V>
where L: Integer, M: Integer, T: Integer, I: Integer, Th: Integer, N: Integer, J: Integer, Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

source§

fn from( val: Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ur, V> ) -> Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn SolidAngleKind>, Ul, V>

Converts to this type from the input type.
source§

impl<L, M, T, I, Th, N, J, Ul, Ur, V> From<Quantity<dyn Dimension<L = L, T = T, Th = Th, I = I, M = M, N = N, J = J, Kind = dyn SolidAngleKind>, Ur, V>> for Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ul, V>
where L: Integer, M: Integer, T: Integer, I: Integer, Th: Integer, N: Integer, J: Integer, Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V>,

source§

fn from( val: Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn SolidAngleKind>, Ur, V> ) -> Quantity<dyn Dimension<L = L, M = M, T = T, I = I, Th = Th, N = N, J = J, Kind = dyn Kind>, Ul, V>

Converts to this type from the input type.
source§

impl<U> From<Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, U, u16>> for u16
where U: Units<Self> + ?Sized, Self: Num + Conversion<Self>,

source§

fn from(t: Ratio<U, Self>) -> Self

Converts to this type from the input type.
source§

impl<U> From<Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, U, u32>> for u32
where U: Units<Self> + ?Sized, Self: Num + Conversion<Self>,

source§

fn from(t: Ratio<U, Self>) -> Self

Converts to this type from the input type.
source§

impl<U> From<Quantity<dyn Dimension<L = Z0, T = Z0, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, U, u8>> for u8
where U: Units<Self> + ?Sized, Self: Num + Conversion<Self>,

source§

fn from(t: Ratio<U, Self>) -> Self

Converts to this type from the input type.
source§

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

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<D, U> Mul<Quantity<D, U, u16>> for u16
where D: Dimension + ?Sized, D::Kind: Mul, U: Units<u16> + ?Sized, Z0: Add<D::L> + Add<D::M> + Add<D::T> + Add<D::I> + Add<D::Th> + Add<D::N> + Add<D::J>, <Z0 as Add<D::L>>::Output: Integer, <Z0 as Add<D::M>>::Output: Integer, <Z0 as Add<D::T>>::Output: Integer, <Z0 as Add<D::I>>::Output: Integer, <Z0 as Add<D::Th>>::Output: Integer, <Z0 as Add<D::N>>::Output: Integer, <Z0 as Add<D::J>>::Output: Integer,

§

type Output = Quantity<dyn Dimension<L = <Z0 as Add<<D as Dimension>::L>>::Output, T = <Z0 as Add<<D as Dimension>::T>>::Output, Th = <Z0 as Add<<D as Dimension>::Th>>::Output, I = <Z0 as Add<<D as Dimension>::I>>::Output, M = <Z0 as Add<<D as Dimension>::M>>::Output, N = <Z0 as Add<<D as Dimension>::N>>::Output, J = <Z0 as Add<<D as Dimension>::J>>::Output, Kind = <D as Dimension>::Kind>, U, u16>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Quantity<D, U, u16>) -> Self::Output

Performs the * operation. Read more
source§

impl<D, U> Mul<Quantity<D, U, u32>> for u32
where D: Dimension + ?Sized, D::Kind: Mul, U: Units<u32> + ?Sized, Z0: Add<D::L> + Add<D::M> + Add<D::T> + Add<D::I> + Add<D::Th> + Add<D::N> + Add<D::J>, <Z0 as Add<D::L>>::Output: Integer, <Z0 as Add<D::M>>::Output: Integer, <Z0 as Add<D::T>>::Output: Integer, <Z0 as Add<D::I>>::Output: Integer, <Z0 as Add<D::Th>>::Output: Integer, <Z0 as Add<D::N>>::Output: Integer, <Z0 as Add<D::J>>::Output: Integer,

§

type Output = Quantity<dyn Dimension<L = <Z0 as Add<<D as Dimension>::L>>::Output, T = <Z0 as Add<<D as Dimension>::T>>::Output, Th = <Z0 as Add<<D as Dimension>::Th>>::Output, I = <Z0 as Add<<D as Dimension>::I>>::Output, M = <Z0 as Add<<D as Dimension>::M>>::Output, N = <Z0 as Add<<D as Dimension>::N>>::Output, J = <Z0 as Add<<D as Dimension>::J>>::Output, Kind = <D as Dimension>::Kind>, U, u32>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Quantity<D, U, u32>) -> Self::Output

Performs the * operation. Read more
source§

impl<D, U> Mul<Quantity<D, U, u8>> for u8
where D: Dimension + ?Sized, D::Kind: Mul, U: Units<u8> + ?Sized, Z0: Add<D::L> + Add<D::M> + Add<D::T> + Add<D::I> + Add<D::Th> + Add<D::N> + Add<D::J>, <Z0 as Add<D::L>>::Output: Integer, <Z0 as Add<D::M>>::Output: Integer, <Z0 as Add<D::T>>::Output: Integer, <Z0 as Add<D::I>>::Output: Integer, <Z0 as Add<D::Th>>::Output: Integer, <Z0 as Add<D::N>>::Output: Integer, <Z0 as Add<D::J>>::Output: Integer,

§

type Output = Quantity<dyn Dimension<L = <Z0 as Add<<D as Dimension>::L>>::Output, T = <Z0 as Add<<D as Dimension>::T>>::Output, Th = <Z0 as Add<<D as Dimension>::Th>>::Output, I = <Z0 as Add<<D as Dimension>::I>>::Output, M = <Z0 as Add<<D as Dimension>::M>>::Output, N = <Z0 as Add<<D as Dimension>::N>>::Output, J = <Z0 as Add<<D as Dimension>::J>>::Output, Kind = <D as Dimension>::Kind>, U, u8>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Quantity<D, U, u8>) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = Quantity<dyn Dimension<L = <<Dl as Dimension>::L as Add<<Dr as Dimension>::L>>::Output, T = <<Dl as Dimension>::T as Add<<Dr as Dimension>::T>>::Output, Th = <<Dl as Dimension>::Th as Add<<Dr as Dimension>::Th>>::Output, I = <<Dl as Dimension>::I as Add<<Dr as Dimension>::I>>::Output, M = <<Dl as Dimension>::M as Add<<Dr as Dimension>::M>>::Output, N = <<Dl as Dimension>::N as Add<<Dr as Dimension>::N>>::Output, J = <<Dl as Dimension>::J as Add<<Dr as Dimension>::J>>::Output, Kind = dyn Kind>, Ul, V>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Quantity<Dr, Ur, V>) -> Self::Output

Performs the * operation. Read more
source§

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

§

type Output = Quantity<D, U, V>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: V) -> Self::Output

Performs the * operation. Read more
source§

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

source§

fn mul_assign(&mut self, rhs: V)

Performs the *= operation. Read more
source§

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

§

type Output = Quantity<D, U, V>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

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

source§

fn cmp(&self, other: &Self) -> Ordering

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

fn max(self, other: Self) -> Self

Compares and returns the maximum of two values. Read more
source§

fn min(self, other: Self) -> Self

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

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

source§

fn eq(&self, other: &Quantity<D, Ur, V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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

source§

fn partial_cmp(&self, other: &Quantity<D, Ur, V>) -> Option<Ordering>

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

fn lt(&self, other: &Quantity<D, Ur, V>) -> bool

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

fn le(&self, other: &Quantity<D, Ur, V>) -> bool

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

fn gt(&self, other: &Quantity<D, Ur, V>) -> bool

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

fn ge(&self, other: &Quantity<D, Ur, V>) -> bool

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

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

§

type Output = Quantity<D, Ul, V>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Quantity<D, Ur, V>) -> Self::Output

Performs the % operation. Read more
source§

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

source§

fn rem_assign(&mut self, rhs: Quantity<D, Ur, V>)

Performs the %= operation. Read more
source§

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

source§

fn saturating_add(self, v: Self) -> Self

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

fn saturating_sub(self, v: Self) -> Self

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

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

§

type Output = Quantity<D, Ul, V>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

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

§

type Output = Quantity<dyn Dimension<L = Z0, T = Z0, Th = PInt<UInt<UTerm, B1>>, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn TemperatureKind>, 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<D, Ul, Ur, V> SubAssign<Quantity<D, Ur, V>> for Quantity<D, Ul, V>
where D: Dimension + ?Sized, D::Kind: SubAssign, Ul: Units<V> + ?Sized, Ur: Units<V> + ?Sized, V: Num + Conversion<V> + SubAssign<V>,

source§

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

Performs the -= operation. Read more
source§

impl<Ul, Ur, V> SubAssign<Quantity<dyn Dimension<L = Z0, T = Z0, Th = PInt<UInt<UTerm, B1>>, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, 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
source§

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

source§

fn sum<I>(iter: I) -> Self
where I: Iterator<Item = Self>,

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<U, V> TryFrom<Quantity<dyn Dimension<L = Z0, T = PInt<UInt<UTerm, B1>>, Th = Z0, I = Z0, M = Z0, N = Z0, J = Z0, Kind = dyn Kind>, U, V>> for Duration
where U: Units<V> + ?Sized, V: Num + Conversion<V> + PartialOrd + ToPrimitive, second: Conversion<V, T = V::T>, nanosecond: Conversion<V, T = V::T>,

Attempt to convert the given Time to a Duration.

For possible failure modes see TryFromError.

§Notes

The Duration to Time conversion is tested to be accurate to within 1 nanosecond (to allow for floating point rounding error). If greater precision is needed, consider using a different underlying storage type or avoiding the conversion altogether.

§

type Error = TryFromError

The type returned in the event of a conversion error.
source§

fn try_from(time: Time<U, V>) -> Result<Self, Self::Error>

Performs the conversion.
source§

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

source§

fn zero() -> Self

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

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

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

source§

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

Auto Trait Implementations§

§

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

§

impl<D, U, V> RefUnwindSafe for Quantity<D, U, V>

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,