#[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

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

A half turn, i.e. an angle with a value of π as measured in radians

A full turn, i.e. an angle with a value of 2π as measured in radians

A half turn, i.e. an angle with a value of π as measured in radians

A full turn, i.e. an angle with a value of 2π as measured in radians

Implementation of various stdlib trigonometric functions

Computes the value of the cosine of the angle.

Computes the value of the hyperbolic cosine of the angle.

Computes the value of the sine of the angle.

Computes the value of the hyperbolic sine of the angle.

Computes the value of both the sine and cosine of the angle.

Computes the value of the tangent of the angle.

Computes the value of the hyperbolic tangent of the angle.

Computes the four quadrant arctangent of self (y) and other (x).

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

Implementation of various stdlib inverse trigonometric functions

Computes the value of the inverse cosine of the ratio.

Computes the value of the inverse hyperbolic cosine of the ratio.

Computes the value of the inverse sine of the ratio.

Computes the value of the inverse hyperbolic sine of the ratio.

Computes the value of the inverse tangent of the ratio.

Computes the value of the inverse hyperbolic tangent of the ratio.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

The solid angle subtended by a sphere at its center, i.e. with a value 4π as measured in steradians.

The solid angle subtended by a sphere at its center, i.e. with a value 4π as measured in steradians.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • N: Unit.

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.

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

Generic Parameters
  • N: Unit.

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

Generic Parameters
  • 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.

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.

Returns true if this value is NAN and false otherwise.

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

Returns true if this number is neither infinite nor NAN.

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

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

Takes the cubic root of a number.

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

The input type must have dimensions divisible by three:

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

Calculates the length of the hypotenuse of a right-angle triangle given the legs.

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

Returns a quantity that represents the sign of self.

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

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

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

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

Generic Parameters
  • Da: Dimension for parameter a.
  • Ua: Base units for parameter a.
  • Ub: Base units for parameter b.

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

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

Raises a quantity to an integer power.

use uom::typenum::P2;

let a: Area = Length::new::<meter>(3.0).powi(P2::new());
Generic Parameters
  • E: typenum::Integer power.

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

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

The input type must have dimensions divisible by two:

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

Returns the maximum of the two quantities.

Returns the minimum of the two quantities.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Constant representing the zero value.

Formats the value using the given formatter. Read more

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

Deserialize this value from the given Serde deserializer. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the /= operation. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

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

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

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

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

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

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

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

The resulting type after applying the % operator.

Performs the % operation. Read more

Performs the %= operation. Read more

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

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

Serialize this value into the given Serde serializer. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

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

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.

The type returned in the event of a conversion error.

Performs the conversion.

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

Returns true if self is equal to the additive identity.

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.