pub struct Length { /* private fields */ }Expand description
Length (base UnitDefinition meter, m).
Scalar storage of a quantity (f64 and LengthUnit).
Implementations§
Source§impl Length
impl Length
Sourcepub fn new(value: f64, unit: LengthUnit) -> Self
pub fn new(value: f64, unit: LengthUnit) -> Self
Create a new LengthUnit.
Sourcepub fn yottameter(value: f64) -> Self
pub fn yottameter(value: f64) -> Self
Create a new Length with units of LengthUnit::yottameter.
Sourcepub fn zettameter(value: f64) -> Self
pub fn zettameter(value: f64) -> Self
Create a new Length with units of LengthUnit::zettameter.
Sourcepub fn exameter(value: f64) -> Self
pub fn exameter(value: f64) -> Self
Create a new Length with units of LengthUnit::exameter.
Sourcepub fn petameter(value: f64) -> Self
pub fn petameter(value: f64) -> Self
Create a new Length with units of LengthUnit::petameter.
Sourcepub fn terameter(value: f64) -> Self
pub fn terameter(value: f64) -> Self
Create a new Length with units of LengthUnit::terameter.
Sourcepub fn gigameter(value: f64) -> Self
pub fn gigameter(value: f64) -> Self
Create a new Length with units of LengthUnit::gigameter.
Sourcepub fn megameter(value: f64) -> Self
pub fn megameter(value: f64) -> Self
Create a new Length with units of LengthUnit::megameter.
Sourcepub fn kilometer(value: f64) -> Self
pub fn kilometer(value: f64) -> Self
Create a new Length with units of LengthUnit::kilometer.
Sourcepub fn hectometer(value: f64) -> Self
pub fn hectometer(value: f64) -> Self
Create a new Length with units of LengthUnit::hectometer.
Sourcepub fn decameter(value: f64) -> Self
pub fn decameter(value: f64) -> Self
Create a new Length with units of LengthUnit::decameter.
Sourcepub fn meter(value: f64) -> Self
pub fn meter(value: f64) -> Self
Create a new Length with units of LengthUnit::meter.
Sourcepub fn decimeter(value: f64) -> Self
pub fn decimeter(value: f64) -> Self
Create a new Length with units of LengthUnit::decimeter.
Sourcepub fn centimeter(value: f64) -> Self
pub fn centimeter(value: f64) -> Self
Create a new Length with units of LengthUnit::centimeter.
Sourcepub fn millimeter(value: f64) -> Self
pub fn millimeter(value: f64) -> Self
Create a new Length with units of LengthUnit::millimeter.
Sourcepub fn micrometer(value: f64) -> Self
pub fn micrometer(value: f64) -> Self
Create a new Length with units of LengthUnit::micrometer.
Sourcepub fn nanometer(value: f64) -> Self
pub fn nanometer(value: f64) -> Self
Create a new Length with units of LengthUnit::nanometer.
Sourcepub fn picometer(value: f64) -> Self
pub fn picometer(value: f64) -> Self
Create a new Length with units of LengthUnit::picometer.
Sourcepub fn femtometer(value: f64) -> Self
pub fn femtometer(value: f64) -> Self
Create a new Length with units of LengthUnit::femtometer.
Sourcepub fn attometer(value: f64) -> Self
pub fn attometer(value: f64) -> Self
Create a new Length with units of LengthUnit::attometer.
Sourcepub fn zeptometer(value: f64) -> Self
pub fn zeptometer(value: f64) -> Self
Create a new Length with units of LengthUnit::zeptometer.
Sourcepub fn yoctometer(value: f64) -> Self
pub fn yoctometer(value: f64) -> Self
Create a new Length with units of LengthUnit::yoctometer.
Sourcepub fn angstrom(value: f64) -> Self
pub fn angstrom(value: f64) -> Self
Create a new Length with units of LengthUnit::angstrom.
Sourcepub fn bohr_radius(value: f64) -> Self
pub fn bohr_radius(value: f64) -> Self
Create a new Length with units of LengthUnit::bohr_radius.
Sourcepub fn atomic_unit_of_length(value: f64) -> Self
pub fn atomic_unit_of_length(value: f64) -> Self
Create a new Length with units of LengthUnit::atomic_unit_of_length.
Sourcepub fn astronomical_unit(value: f64) -> Self
pub fn astronomical_unit(value: f64) -> Self
Create a new Length with units of LengthUnit::astronomical_unit.
Sourcepub fn chain(value: f64) -> Self
pub fn chain(value: f64) -> Self
Create a new Length with units of LengthUnit::chain.
Sourcepub fn fathom(value: f64) -> Self
pub fn fathom(value: f64) -> Self
Create a new Length with units of LengthUnit::fathom.
Sourcepub fn fermi(value: f64) -> Self
pub fn fermi(value: f64) -> Self
Create a new Length with units of LengthUnit::fermi.
Sourcepub fn foot(value: f64) -> Self
pub fn foot(value: f64) -> Self
Create a new Length with units of LengthUnit::foot.
Sourcepub fn kilofoot(value: f64) -> Self
pub fn kilofoot(value: f64) -> Self
Create a new Length with units of LengthUnit::kilofoot.
Sourcepub fn foot_survey(value: f64) -> Self
pub fn foot_survey(value: f64) -> Self
Create a new Length with units of LengthUnit::foot_survey.
Sourcepub fn inch(value: f64) -> Self
pub fn inch(value: f64) -> Self
Create a new Length with units of LengthUnit::inch.
Sourcepub fn light_year(value: f64) -> Self
pub fn light_year(value: f64) -> Self
Create a new Length with units of LengthUnit::light_year.
Sourcepub fn microinch(value: f64) -> Self
pub fn microinch(value: f64) -> Self
Create a new Length with units of LengthUnit::microinch.
Sourcepub fn micron(value: f64) -> Self
pub fn micron(value: f64) -> Self
Create a new Length with units of LengthUnit::micron.
Sourcepub fn mil(value: f64) -> Self
pub fn mil(value: f64) -> Self
Create a new Length with units of LengthUnit::mil.
Sourcepub fn mile(value: f64) -> Self
pub fn mile(value: f64) -> Self
Create a new Length with units of LengthUnit::mile.
Sourcepub fn mile_survey(value: f64) -> Self
pub fn mile_survey(value: f64) -> Self
Create a new Length with units of LengthUnit::mile_survey.
Sourcepub fn nautical_mile(value: f64) -> Self
pub fn nautical_mile(value: f64) -> Self
Create a new Length with units of LengthUnit::nautical_mile.
Sourcepub fn parsec(value: f64) -> Self
pub fn parsec(value: f64) -> Self
Create a new Length with units of LengthUnit::parsec.
Sourcepub fn pica_computer(value: f64) -> Self
pub fn pica_computer(value: f64) -> Self
Create a new Length with units of LengthUnit::pica_computer.
Sourcepub fn pica_printers(value: f64) -> Self
pub fn pica_printers(value: f64) -> Self
Create a new Length with units of LengthUnit::pica_printers.
Sourcepub fn point_computer(value: f64) -> Self
pub fn point_computer(value: f64) -> Self
Create a new Length with units of LengthUnit::point_computer.
Sourcepub fn point_printers(value: f64) -> Self
pub fn point_printers(value: f64) -> Self
Create a new Length with units of LengthUnit::point_printers.
Sourcepub fn rod(value: f64) -> Self
pub fn rod(value: f64) -> Self
Create a new Length with units of LengthUnit::rod.
Sourcepub fn yard(value: f64) -> Self
pub fn yard(value: f64) -> Self
Create a new Length with units of LengthUnit::yard.
Sourcepub fn value_mut(&mut self) -> &mut f64
pub fn value_mut(&mut self) -> &mut f64
Retrieve the mutable value associated with this Length.
Sourcepub fn definition(&self) -> UnitDefinition
pub fn definition(&self) -> UnitDefinition
Retrieve the UnitDefinition associated with this Length.
Sourcepub fn to_yottameter(&self) -> Self
pub fn to_yottameter(&self) -> Self
Convert to LengthUnit::yottameter.
Sourcepub fn to_zettameter(&self) -> Self
pub fn to_zettameter(&self) -> Self
Convert to LengthUnit::zettameter.
Sourcepub fn to_exameter(&self) -> Self
pub fn to_exameter(&self) -> Self
Convert to LengthUnit::exameter.
Sourcepub fn to_petameter(&self) -> Self
pub fn to_petameter(&self) -> Self
Convert to LengthUnit::petameter.
Sourcepub fn to_terameter(&self) -> Self
pub fn to_terameter(&self) -> Self
Convert to LengthUnit::terameter.
Sourcepub fn to_gigameter(&self) -> Self
pub fn to_gigameter(&self) -> Self
Convert to LengthUnit::gigameter.
Sourcepub fn to_megameter(&self) -> Self
pub fn to_megameter(&self) -> Self
Convert to LengthUnit::megameter.
Sourcepub fn to_kilometer(&self) -> Self
pub fn to_kilometer(&self) -> Self
Convert to LengthUnit::kilometer.
Sourcepub fn to_hectometer(&self) -> Self
pub fn to_hectometer(&self) -> Self
Convert to LengthUnit::hectometer.
Sourcepub fn to_decameter(&self) -> Self
pub fn to_decameter(&self) -> Self
Convert to LengthUnit::decameter.
Sourcepub fn to_meter(&self) -> Self
pub fn to_meter(&self) -> Self
Convert to LengthUnit::meter.
Sourcepub fn to_decimeter(&self) -> Self
pub fn to_decimeter(&self) -> Self
Convert to LengthUnit::decimeter.
Sourcepub fn to_centimeter(&self) -> Self
pub fn to_centimeter(&self) -> Self
Convert to LengthUnit::centimeter.
Sourcepub fn to_millimeter(&self) -> Self
pub fn to_millimeter(&self) -> Self
Convert to LengthUnit::millimeter.
Sourcepub fn to_micrometer(&self) -> Self
pub fn to_micrometer(&self) -> Self
Convert to LengthUnit::micrometer.
Sourcepub fn to_nanometer(&self) -> Self
pub fn to_nanometer(&self) -> Self
Convert to LengthUnit::nanometer.
Sourcepub fn to_picometer(&self) -> Self
pub fn to_picometer(&self) -> Self
Convert to LengthUnit::picometer.
Sourcepub fn to_femtometer(&self) -> Self
pub fn to_femtometer(&self) -> Self
Convert to LengthUnit::femtometer.
Sourcepub fn to_attometer(&self) -> Self
pub fn to_attometer(&self) -> Self
Convert to LengthUnit::attometer.
Sourcepub fn to_zeptometer(&self) -> Self
pub fn to_zeptometer(&self) -> Self
Convert to LengthUnit::zeptometer.
Sourcepub fn to_yoctometer(&self) -> Self
pub fn to_yoctometer(&self) -> Self
Convert to LengthUnit::yoctometer.
Sourcepub fn to_angstrom(&self) -> Self
pub fn to_angstrom(&self) -> Self
Convert to LengthUnit::angstrom.
Sourcepub fn to_bohr_radius(&self) -> Self
pub fn to_bohr_radius(&self) -> Self
Convert to LengthUnit::bohr_radius.
Sourcepub fn to_atomic_unit_of_length(&self) -> Self
pub fn to_atomic_unit_of_length(&self) -> Self
Convert to LengthUnit::atomic_unit_of_length.
Sourcepub fn to_astronomical_unit(&self) -> Self
pub fn to_astronomical_unit(&self) -> Self
Convert to LengthUnit::astronomical_unit.
Sourcepub fn to_chain(&self) -> Self
pub fn to_chain(&self) -> Self
Convert to LengthUnit::chain.
Sourcepub fn to_fathom(&self) -> Self
pub fn to_fathom(&self) -> Self
Convert to LengthUnit::fathom.
Sourcepub fn to_fermi(&self) -> Self
pub fn to_fermi(&self) -> Self
Convert to LengthUnit::fermi.
Sourcepub fn to_foot(&self) -> Self
pub fn to_foot(&self) -> Self
Convert to LengthUnit::foot.
Sourcepub fn to_kilofoot(&self) -> Self
pub fn to_kilofoot(&self) -> Self
Convert to LengthUnit::kilofoot.
Sourcepub fn to_foot_survey(&self) -> Self
pub fn to_foot_survey(&self) -> Self
Convert to LengthUnit::foot_survey.
Sourcepub fn to_inch(&self) -> Self
pub fn to_inch(&self) -> Self
Convert to LengthUnit::inch.
Sourcepub fn to_light_year(&self) -> Self
pub fn to_light_year(&self) -> Self
Convert to LengthUnit::light_year.
Sourcepub fn to_microinch(&self) -> Self
pub fn to_microinch(&self) -> Self
Convert to LengthUnit::microinch.
Sourcepub fn to_micron(&self) -> Self
pub fn to_micron(&self) -> Self
Convert to LengthUnit::micron.
Sourcepub fn to_mil(&self) -> Self
pub fn to_mil(&self) -> Self
Convert to LengthUnit::mil.
Sourcepub fn to_mile(&self) -> Self
pub fn to_mile(&self) -> Self
Convert to LengthUnit::mile.
Sourcepub fn to_mile_survey(&self) -> Self
pub fn to_mile_survey(&self) -> Self
Convert to LengthUnit::mile_survey.
Sourcepub fn to_nautical_mile(&self) -> Self
pub fn to_nautical_mile(&self) -> Self
Convert to LengthUnit::nautical_mile.
Sourcepub fn to_parsec(&self) -> Self
pub fn to_parsec(&self) -> Self
Convert to LengthUnit::parsec.
Sourcepub fn to_pica_computer(&self) -> Self
pub fn to_pica_computer(&self) -> Self
Convert to LengthUnit::pica_computer.
Sourcepub fn to_pica_printers(&self) -> Self
pub fn to_pica_printers(&self) -> Self
Convert to LengthUnit::pica_printers.
Sourcepub fn to_point_computer(&self) -> Self
pub fn to_point_computer(&self) -> Self
Convert to LengthUnit::point_computer.
Sourcepub fn to_point_printers(&self) -> Self
pub fn to_point_printers(&self) -> Self
Convert to LengthUnit::point_printers.
Sourcepub fn to_rod(&self) -> Self
pub fn to_rod(&self) -> Self
Convert to LengthUnit::rod.
Sourcepub fn to_yard(&self) -> Self
pub fn to_yard(&self) -> Self
Convert to LengthUnit::yard.
Trait Implementations§
Source§impl AddAssign<Quantity> for Length
impl AddAssign<Quantity> for Length
Source§fn add_assign(&mut self, rhs: Quantity)
fn add_assign(&mut self, rhs: Quantity)
+= operation. Read moreSource§impl AddAssign for Length
impl AddAssign for Length
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl DivAssign<f64> for Length
impl DivAssign<f64> for Length
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
/= operation. Read moreSource§impl FixedQuantity<LengthUnit> for Length
impl FixedQuantity<LengthUnit> for Length
Source§fn unit(&self) -> LengthUnit
fn unit(&self) -> LengthUnit
Source§fn convert(&self, unit: LengthUnit) -> Self
fn convert(&self, unit: LengthUnit) -> Self
Source§fn convert_mut(&mut self, unit: LengthUnit)
fn convert_mut(&mut self, unit: LengthUnit)
Source§fn unit_mut(&mut self) -> &mut LengthUnit
fn unit_mut(&mut self) -> &mut LengthUnit
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<Length> for UnitDefinition
impl From<Length> for UnitDefinition
Source§impl MulAssign<f64> for Length
impl MulAssign<f64> for Length
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
*= operation. Read moreSource§impl PartialOrd for Length
impl PartialOrd for Length
Source§impl SubAssign<Quantity> for Length
impl SubAssign<Quantity> for Length
Source§fn sub_assign(&mut self, rhs: Quantity)
fn sub_assign(&mut self, rhs: Quantity)
-= operation. Read moreSource§impl SubAssign for Length
impl SubAssign for Length
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read more