pub enum LengthUnit {
Kilometer,
Lightsecond,
AstronomicalUnit,
Lightyear,
Parsec,
Kilolightyear,
Kiloparsec,
Megalightyear,
Megaparsec,
Gigalightyear,
Gigaparsec,
}Expand description
Unit of quantity Length.
Variants
Kilometer
1000·m
Lightsecond
299792458·m
AstronomicalUnit
Reference unit of quantity Length (= 149597870700·m)
Lightyear
31557600·ls
Parsec
648000/π·au
Kilolightyear
1000·ly
Kiloparsec
1000·pc
Megalightyear
10⁶·ly
Megaparsec
10⁶·pc
Gigalightyear
10⁹·ly
Gigaparsec
10⁹·pc
Trait Implementations
sourceimpl Clone for LengthUnit
impl Clone for LengthUnit
sourcefn clone(&self) -> LengthUnit
fn clone(&self) -> LengthUnit
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for LengthUnit
impl Debug for LengthUnit
sourceimpl Display for LengthUnit
impl Display for LengthUnit
sourceimpl LinearScaledUnit for LengthUnit
impl LinearScaledUnit for LengthUnit
sourcefn from_scale(amnt: f64) -> Option<Self>
fn from_scale(amnt: f64) -> Option<Self>
Returns Some(unit) where unit.scale() == Some(amnt), or None if
there is no such unit. Read more
sourcefn is_ref_unit(&self) -> bool
fn is_ref_unit(&self) -> bool
Returns true if self is the reference unit of its unit type.
sourceimpl Mul<LengthUnit> for AmountT
impl Mul<LengthUnit> for AmountT
sourceimpl Mul<f64> for LengthUnit
impl Mul<f64> for LengthUnit
sourceimpl PartialEq<LengthUnit> for LengthUnit
impl PartialEq<LengthUnit> for LengthUnit
sourceimpl Unit for LengthUnit
impl Unit for LengthUnit
type QuantityType = Length
type QuantityType = Length
Associated type of quantity
sourcefn si_prefix(&self) -> Option<SIPrefix>
fn si_prefix(&self) -> Option<SIPrefix>
Returns the SI prefix of self, or None is self is not a SI unit.
sourcefn from_symbol(symbol: &str) -> Option<Self>
fn from_symbol(symbol: &str) -> Option<Self>
Returns Some(unit) where unit.symbol() == symbol, or None if
there is no such unit. Read more
sourcefn as_qty(&self) -> Self::QuantityType
fn as_qty(&self) -> Self::QuantityType
Returns 1 * self
impl Copy for LengthUnit
impl Eq for LengthUnit
impl StructuralEq for LengthUnit
impl StructuralPartialEq for LengthUnit
Auto Trait Implementations
impl RefUnwindSafe for LengthUnit
impl Send for LengthUnit
impl Sync for LengthUnit
impl Unpin for LengthUnit
impl UnwindSafe for LengthUnit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more