Struct runtime_units::Mass
source · pub struct Mass {
pub value: f64,
pub unit: MassUnit,
}Expand description
Mass (base unit kilogram, kg).
Fields§
§value: f64§unit: MassUnitImplementations§
source§impl Mass
impl Mass
pub fn new(value: f64, unit: MassUnit) -> Self
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.