Module mag::mass

source · []
Expand description

Units of physical mass.

Each unit is defined relative to grams with a conversion factor. They can be used to conveniently create Mass quantities.

Example

use mag::mass::{g, kg};

let a = 1.2 * kg;
let b = 5 * g;

assert_eq!(a.to_string(), "1.2 kg");
assert_eq!(b.to_string(), "5 g");

Structs

Dalton (unified atomic mass)

Centigram

Decigram

Gram

Kilogram

Pound (imperial)

Milligram

Nanogram

Slug (imperial)

Metric Ton / Tonne

Microgram