#[non_exhaustive]pub enum Mass {
ShortTon,
LongTon,
Pound,
Ounce,
Tonne,
Kilogram,
Gram,
Centigram,
Milligram,
Microgram,
AtomicMassUnit,
}Expand description
A unit of mass.
The listed abbreviations are the abbreviations used to parse the unit with
FromStr. The main abbreviation comes first, followed by any alternate
abbreviations that can be used.
The conversions are listed in terms of the base unit. The base unit for
Mass is Mass::Kilogram.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ShortTon
A US (short) ton (2000 pounds).
-
Abbreviation:
tn -
1 tn = 907.18474 kg
LongTon
An imperial (long) ton (2240 pounds).
-
Abbreviation:
lt -
1 lt = 1016.0469088 kg
Pound
-
Abbreviation:
lb -
1 lb = 0.45359237 kg
Ounce
-
Abbreviation:
oz -
1 oz = 0.028349523125 kg
Tonne
A metric tonne (1000 kilograms).
-
Abbreviation:
t -
1 t = 1000.0 kg
Kilogram
-
Abbreviation:
kg -
1 kg = 1.0 kg
Gram
-
Abbreviation:
g -
1 g = 0.001 kg
Centigram
-
Abbreviation:
cg -
1 cg = 1e-5 kg
Milligram
-
Abbreviation:
mg -
1 mg = 1e-6 kg
Microgram
-
Abbreviation:
µg,ug -
1 µg = 1e-9 kg
AtomicMassUnit
An atomic mass unit (1/12 of the mass of a carbon 12 atom).
-
Abbreviation:
amu -
1 amu = 1.66053906892e-27 kg
Implementations§
Trait Implementations§
Source§impl Convert for Mass
impl Convert for Mass
Source§fn conversion_factor(&self) -> f64
fn conversion_factor(&self) -> f64
&self to Convert::BASE, i.e. the value to multiply
a quantity in this unit by, in order to get a quantity in Convert::BASE. If the self
unit is the same as this unit, then this function should return 1.0. Read moreSource§fn conversion_factor_to(&self, _: impl Into<Unit>) -> Option<f64>
fn conversion_factor_to(&self, _: impl Into<Unit>) -> Option<f64>
Convert::BASE, to a base unit that Convert::BASE
is derived from. Returns None if there is no conversion factor, meaning the two units
are unrelated. Read more