pub struct Mass { /* private fields */ }Expand description
Mass (base UnitDefinition kilogram, kg).
Scalar storage of a quantity (f64 and MassUnit).
Implementations§
Source§impl Mass
impl Mass
Sourcepub fn yottagram(value: f64) -> Self
pub fn yottagram(value: f64) -> Self
Create a new Mass with units of MassUnit::yottagram.
Sourcepub fn zettagram(value: f64) -> Self
pub fn zettagram(value: f64) -> Self
Create a new Mass with units of MassUnit::zettagram.
Sourcepub fn exagram(value: f64) -> Self
pub fn exagram(value: f64) -> Self
Create a new Mass with units of MassUnit::exagram.
Sourcepub fn petagram(value: f64) -> Self
pub fn petagram(value: f64) -> Self
Create a new Mass with units of MassUnit::petagram.
Sourcepub fn teragram(value: f64) -> Self
pub fn teragram(value: f64) -> Self
Create a new Mass with units of MassUnit::teragram.
Sourcepub fn gigagram(value: f64) -> Self
pub fn gigagram(value: f64) -> Self
Create a new Mass with units of MassUnit::gigagram.
Sourcepub fn megagram(value: f64) -> Self
pub fn megagram(value: f64) -> Self
Create a new Mass with units of MassUnit::megagram.
Sourcepub fn kilogram(value: f64) -> Self
pub fn kilogram(value: f64) -> Self
Create a new Mass with units of MassUnit::kilogram.
Sourcepub fn hectogram(value: f64) -> Self
pub fn hectogram(value: f64) -> Self
Create a new Mass with units of MassUnit::hectogram.
Sourcepub fn decagram(value: f64) -> Self
pub fn decagram(value: f64) -> Self
Create a new Mass with units of MassUnit::decagram.
Sourcepub fn gram(value: f64) -> Self
pub fn gram(value: f64) -> Self
Create a new Mass with units of MassUnit::gram.
Sourcepub fn decigram(value: f64) -> Self
pub fn decigram(value: f64) -> Self
Create a new Mass with units of MassUnit::decigram.
Sourcepub fn centigram(value: f64) -> Self
pub fn centigram(value: f64) -> Self
Create a new Mass with units of MassUnit::centigram.
Sourcepub fn milligram(value: f64) -> Self
pub fn milligram(value: f64) -> Self
Create a new Mass with units of MassUnit::milligram.
Sourcepub fn microgram(value: f64) -> Self
pub fn microgram(value: f64) -> Self
Create a new Mass with units of MassUnit::microgram.
Sourcepub fn nanogram(value: f64) -> Self
pub fn nanogram(value: f64) -> Self
Create a new Mass with units of MassUnit::nanogram.
Sourcepub fn picogram(value: f64) -> Self
pub fn picogram(value: f64) -> Self
Create a new Mass with units of MassUnit::picogram.
Sourcepub fn femtogram(value: f64) -> Self
pub fn femtogram(value: f64) -> Self
Create a new Mass with units of MassUnit::femtogram.
Sourcepub fn attogram(value: f64) -> Self
pub fn attogram(value: f64) -> Self
Create a new Mass with units of MassUnit::attogram.
Sourcepub fn zeptogram(value: f64) -> Self
pub fn zeptogram(value: f64) -> Self
Create a new Mass with units of MassUnit::zeptogram.
Sourcepub fn yoctogram(value: f64) -> Self
pub fn yoctogram(value: f64) -> Self
Create a new Mass with units of MassUnit::yoctogram.
Sourcepub fn carat(value: f64) -> Self
pub fn carat(value: f64) -> Self
Create a new Mass with units of MassUnit::carat.
Sourcepub fn dalton(value: f64) -> Self
pub fn dalton(value: f64) -> Self
Create a new Mass with units of MassUnit::dalton.
Sourcepub fn grain(value: f64) -> Self
pub fn grain(value: f64) -> Self
Create a new Mass with units of MassUnit::grain.
Sourcepub fn hundredweight_long(value: f64) -> Self
pub fn hundredweight_long(value: f64) -> Self
Create a new Mass with units of MassUnit::hundredweight_long.
Sourcepub fn hundredweight_short(value: f64) -> Self
pub fn hundredweight_short(value: f64) -> Self
Create a new Mass with units of MassUnit::hundredweight_short.
Sourcepub fn ounce(value: f64) -> Self
pub fn ounce(value: f64) -> Self
Create a new Mass with units of MassUnit::ounce.
Sourcepub fn ounce_troy(value: f64) -> Self
pub fn ounce_troy(value: f64) -> Self
Create a new Mass with units of MassUnit::ounce_troy.
Sourcepub fn pennyweight(value: f64) -> Self
pub fn pennyweight(value: f64) -> Self
Create a new Mass with units of MassUnit::pennyweight.
Sourcepub fn pound(value: f64) -> Self
pub fn pound(value: f64) -> Self
Create a new Mass with units of MassUnit::pound.
Sourcepub fn pound_troy(value: f64) -> Self
pub fn pound_troy(value: f64) -> Self
Create a new Mass with units of MassUnit::pound_troy.
Sourcepub fn slug(value: f64) -> Self
pub fn slug(value: f64) -> Self
Create a new Mass with units of MassUnit::slug.
Sourcepub fn ton_assay(value: f64) -> Self
pub fn ton_assay(value: f64) -> Self
Create a new Mass with units of MassUnit::ton_assay.
Sourcepub fn ton_long(value: f64) -> Self
pub fn ton_long(value: f64) -> Self
Create a new Mass with units of MassUnit::ton_long.
Sourcepub fn ton_short(value: f64) -> Self
pub fn ton_short(value: f64) -> Self
Create a new Mass with units of MassUnit::ton_short.
Sourcepub fn ton(value: f64) -> Self
pub fn ton(value: f64) -> Self
Create a new Mass with units of MassUnit::ton.
Sourcepub fn definition(&self) -> UnitDefinition
pub fn definition(&self) -> UnitDefinition
Retrieve the UnitDefinition associated with this Mass.
Sourcepub fn to_yottagram(&self) -> Self
pub fn to_yottagram(&self) -> Self
Convert to MassUnit::yottagram.
Sourcepub fn to_zettagram(&self) -> Self
pub fn to_zettagram(&self) -> Self
Convert to MassUnit::zettagram.
Sourcepub fn to_exagram(&self) -> Self
pub fn to_exagram(&self) -> Self
Convert to MassUnit::exagram.
Sourcepub fn to_petagram(&self) -> Self
pub fn to_petagram(&self) -> Self
Convert to MassUnit::petagram.
Sourcepub fn to_teragram(&self) -> Self
pub fn to_teragram(&self) -> Self
Convert to MassUnit::teragram.
Sourcepub fn to_gigagram(&self) -> Self
pub fn to_gigagram(&self) -> Self
Convert to MassUnit::gigagram.
Sourcepub fn to_megagram(&self) -> Self
pub fn to_megagram(&self) -> Self
Convert to MassUnit::megagram.
Sourcepub fn to_kilogram(&self) -> Self
pub fn to_kilogram(&self) -> Self
Convert to MassUnit::kilogram.
Sourcepub fn to_hectogram(&self) -> Self
pub fn to_hectogram(&self) -> Self
Convert to MassUnit::hectogram.
Sourcepub fn to_decagram(&self) -> Self
pub fn to_decagram(&self) -> Self
Convert to MassUnit::decagram.
Sourcepub fn to_gram(&self) -> Self
pub fn to_gram(&self) -> Self
Convert to MassUnit::gram.
Sourcepub fn to_decigram(&self) -> Self
pub fn to_decigram(&self) -> Self
Convert to MassUnit::decigram.
Sourcepub fn to_centigram(&self) -> Self
pub fn to_centigram(&self) -> Self
Convert to MassUnit::centigram.
Sourcepub fn to_milligram(&self) -> Self
pub fn to_milligram(&self) -> Self
Convert to MassUnit::milligram.
Sourcepub fn to_microgram(&self) -> Self
pub fn to_microgram(&self) -> Self
Convert to MassUnit::microgram.
Sourcepub fn to_nanogram(&self) -> Self
pub fn to_nanogram(&self) -> Self
Convert to MassUnit::nanogram.
Sourcepub fn to_picogram(&self) -> Self
pub fn to_picogram(&self) -> Self
Convert to MassUnit::picogram.
Sourcepub fn to_femtogram(&self) -> Self
pub fn to_femtogram(&self) -> Self
Convert to MassUnit::femtogram.
Sourcepub fn to_attogram(&self) -> Self
pub fn to_attogram(&self) -> Self
Convert to MassUnit::attogram.
Sourcepub fn to_zeptogram(&self) -> Self
pub fn to_zeptogram(&self) -> Self
Convert to MassUnit::zeptogram.
Sourcepub fn to_yoctogram(&self) -> Self
pub fn to_yoctogram(&self) -> Self
Convert to MassUnit::yoctogram.
Sourcepub fn to_carat(&self) -> Self
pub fn to_carat(&self) -> Self
Convert to MassUnit::carat.
Sourcepub fn to_dalton(&self) -> Self
pub fn to_dalton(&self) -> Self
Convert to MassUnit::dalton.
Sourcepub fn to_grain(&self) -> Self
pub fn to_grain(&self) -> Self
Convert to MassUnit::grain.
Sourcepub fn to_hundredweight_long(&self) -> Self
pub fn to_hundredweight_long(&self) -> Self
Convert to MassUnit::hundredweight_long.
Sourcepub fn to_hundredweight_short(&self) -> Self
pub fn to_hundredweight_short(&self) -> Self
Convert to MassUnit::hundredweight_short.
Sourcepub fn to_ounce(&self) -> Self
pub fn to_ounce(&self) -> Self
Convert to MassUnit::ounce.
Sourcepub fn to_ounce_troy(&self) -> Self
pub fn to_ounce_troy(&self) -> Self
Convert to MassUnit::ounce_troy.
Sourcepub fn to_pennyweight(&self) -> Self
pub fn to_pennyweight(&self) -> Self
Convert to MassUnit::pennyweight.
Sourcepub fn to_pound(&self) -> Self
pub fn to_pound(&self) -> Self
Convert to MassUnit::pound.
Sourcepub fn to_pound_troy(&self) -> Self
pub fn to_pound_troy(&self) -> Self
Convert to MassUnit::pound_troy.
Sourcepub fn to_slug(&self) -> Self
pub fn to_slug(&self) -> Self
Convert to MassUnit::slug.
Sourcepub fn to_ton_assay(&self) -> Self
pub fn to_ton_assay(&self) -> Self
Convert to MassUnit::ton_assay.
Sourcepub fn to_ton_long(&self) -> Self
pub fn to_ton_long(&self) -> Self
Convert to MassUnit::ton_long.
Sourcepub fn to_ton_short(&self) -> Self
pub fn to_ton_short(&self) -> Self
Convert to MassUnit::ton_short.
Sourcepub fn to_ton(&self) -> Self
pub fn to_ton(&self) -> Self
Convert to MassUnit::ton.
Trait Implementations§
Source§impl AddAssign<Quantity> for Mass
impl AddAssign<Quantity> for Mass
Source§fn add_assign(&mut self, rhs: Quantity)
fn add_assign(&mut self, rhs: Quantity)
+= operation. Read moreSource§impl AddAssign for Mass
impl AddAssign for Mass
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl DivAssign<f64> for Mass
impl DivAssign<f64> for Mass
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
/= operation. Read moreSource§impl FixedQuantity<MassUnit> for Mass
impl FixedQuantity<MassUnit> for Mass
Source§fn convert(&self, unit: MassUnit) -> Self
fn convert(&self, unit: MassUnit) -> Self
Source§fn convert_mut(&mut self, unit: MassUnit)
fn convert_mut(&mut self, unit: MassUnit)
Source§fn try_convert(&self, unit: Units) -> Result<Self, RuntimeUnitError>where
Self: Sized,
fn try_convert(&self, unit: Units) -> Result<Self, RuntimeUnitError>where
Self: Sized,
Source§impl From<Mass> for UnitDefinition
impl From<Mass> for UnitDefinition
Source§impl MulAssign<f64> for Mass
impl MulAssign<f64> for Mass
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
*= operation. Read moreSource§impl PartialOrd for Mass
impl PartialOrd for Mass
Source§impl SubAssign<Quantity> for Mass
impl SubAssign<Quantity> for Mass
Source§fn sub_assign(&mut self, rhs: Quantity)
fn sub_assign(&mut self, rhs: Quantity)
-= operation. Read moreSource§impl SubAssign for Mass
impl SubAssign for Mass
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read more