pub enum SpeedUnit {
KilometerPerHour,
MeterPerSecond,
AstronomicalUnitsPerDay,
SpeedOfLight,
}
Expand description
Unit of quantity Speed
.
Variants§
KilometerPerHour
km/h
MeterPerSecond
SI reference unit
AstronomicalUnitsPerDay
Reference unit of quantity Speed
SpeedOfLight
ls/s
Trait Implementations§
Source§impl LinearScaledUnit for SpeedUnit
impl LinearScaledUnit for SpeedUnit
Source§const REF_UNIT: Self = Self::AstronomicalUnitsPerDay
const REF_UNIT: Self = Self::AstronomicalUnitsPerDay
Unit used as reference for scaling the units.
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 Unit for SpeedUnit
impl Unit for SpeedUnit
Source§type QuantityType = Speed
type QuantityType = Speed
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 SpeedUnit
impl Eq for SpeedUnit
impl StructuralPartialEq for SpeedUnit
Auto Trait Implementations§
impl Freeze for SpeedUnit
impl RefUnwindSafe for SpeedUnit
impl Send for SpeedUnit
impl Sync for SpeedUnit
impl Unpin for SpeedUnit
impl UnwindSafe for SpeedUnit
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