#[non_exhaustive]pub enum Volume {
Show 13 variants
Bushel,
Gallon,
Quart,
Pint,
Cup,
FluidOunce,
Tablespoon,
Teaspoon,
Kiloliter,
Liter,
Centiliter,
Milliliter,
Microliter,
}Expand description
A unit of volume.
Measurements of volume are of the same kind as measurements of length with power 3. Thus, any measurement created with a volume unit can be converted to a a length unit cubed, and vice versa.
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
Volume is Volume::Liter.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bushel
A US bushel (2150.42 cubic inches).
-
Abbreviation:
bu -
1 bu = 35.2390704 L
Gallon
A US gallon (231 cubic inches).
-
Abbreviation:
gal -
1 gal = 3.785411784 L
Quart
A US quart (57.75 cubic inches).
-
Abbreviation:
qt -
1 qt = 0.946352946 L
Pint
A US pint (28.875 cubic inches).
-
Abbreviation:
pt -
1 pt = 0.473176473 L
Cup
A US cup (8 fluid ounces).
-
Abbreviation:
c -
1 c = 0.2365882365 L
FluidOunce
A US fluid ounce (1.8046875 cubic inches).
-
Abbreviation:
floz -
1 floz = 0.0295735295625 L
Tablespoon
A US tablespoon (0.90234375 cubic inches).
-
Abbreviation:
tbsp -
1 tbsp = 0.01478676478125 L
Teaspoon
A US teaspoon (0.30078125 cubic inches).
-
Abbreviation:
tsp -
1 tsp = 0.00492892159375 L
Kiloliter
-
Abbreviation:
kL -
1 kL = 1000.0 L
Liter
-
Abbreviation:
L -
1 L = 1.0 L
Centiliter
-
Abbreviation:
cL -
1 cL = 0.01 L
Milliliter
-
Abbreviation:
mL -
1 mL = 0.001 L
Microliter
-
Abbreviation:
µL,uL -
1 µL = 1e-6 L
Implementations§
Trait Implementations§
Source§impl Convert for Volume
impl Convert for Volume
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, target: impl Into<Unit>) -> Option<f64>
fn conversion_factor_to(&self, target: 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