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§
Source§impl Clone for LengthUnit
impl Clone for LengthUnit
Source§fn clone(&self) -> LengthUnit
fn clone(&self) -> LengthUnit
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LengthUnit
impl Debug for LengthUnit
Source§impl Display for LengthUnit
impl Display for LengthUnit
Source§impl LinearScaledUnit for LengthUnit
impl LinearScaledUnit for LengthUnit
Source§fn 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.Source§fn is_ref_unit(&self) -> bool
fn is_ref_unit(&self) -> bool
Returns
true
if self
is the reference unit of its unit type.Source§impl Mul<LengthUnit> for AmountT
impl Mul<LengthUnit> for AmountT
Source§impl Mul<f64> for LengthUnit
impl Mul<f64> for LengthUnit
Source§impl PartialEq for LengthUnit
impl PartialEq for LengthUnit
Source§impl Unit for LengthUnit
impl Unit for LengthUnit
Source§type QuantityType = Length
type QuantityType = Length
Associated type of quantity
Source§fn 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.Source§fn 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.Source§fn as_qty(&self) -> Self::QuantityType
fn as_qty(&self) -> Self::QuantityType
Returns
1 * self
impl Copy for LengthUnit
impl Eq for LengthUnit
impl StructuralPartialEq for LengthUnit
Auto Trait Implementations§
impl Freeze for LengthUnit
impl RefUnwindSafe for LengthUnit
impl Send for LengthUnit
impl Sync for LengthUnit
impl Unpin for LengthUnit
impl UnwindSafe for LengthUnit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more