Velocity

Struct Velocity 

Source
pub struct Velocity {
    pub d: Direction,
}
Expand description

How fast something is moving in a particular direction, in m/s.

This is a vector unit.

Fields§

§d: Direction

Implementations§

Source§

impl Velocity

Source

pub const fn new(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity.

Source

pub fn m(&self) -> Magnitude

Available on crate feature alloc only.

Returns the magnitude, derived from the length of its direction.

Source§

impl Velocity

§SI prefixes constructors: in_* & converters as_*

The Velocity quantity is internally stored in metres per second (m/s).

Source

pub fn in_Qm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in quettametres per second (Qm/s) (10³⁰ m/s).

Source

pub fn in_quettametres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in quettametres per second (Qm/s).

Source

pub fn as_Qm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as quettametres per second (Qm/s) (10³⁰ m/s).

Source

pub fn as_quettametres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as quettametres per second (Qm/s) (10³⁰ m/s).

Source

pub fn in_Rm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in ronnametres per second (Rm/s) (10²⁷ m/s).

Source

pub fn in_ronnametres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in ronnametres per second (Rm/s).

Source

pub fn as_Rm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as ronnametres per second (Rm/s) (10²⁷ m/s).

Source

pub fn as_ronnametres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as ronnametres per second (Rm/s) (10²⁷ m/s).

Source

pub fn in_Ym_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in yottametres per second (Ym/s) (10²⁴ m/s).

Source

pub fn in_yottametres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in yottametres per second (Ym/s).

Source

pub fn as_Ym_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as yottametres per second (Ym/s) (10²⁴ m/s).

Source

pub fn as_yottametres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as yottametres per second (Ym/s) (10²⁴ m/s).

Source

pub fn in_Zm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in zettametres per second (Zm/s) (10²¹ m/s).

Source

pub fn in_zettametres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in zettametres per second (Zm/s).

Source

pub fn as_Zm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as zettametres per second (Zm/s) (10²¹ m/s).

Source

pub fn as_zettametres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as zettametres per second (Zm/s) (10²¹ m/s).

Source

pub fn in_Em_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in exametres per second (Em/s) (10¹⁸ m/s).

Source

pub fn in_exametres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in exametres per second (Em/s).

Source

pub fn as_Em_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as exametres per second (Em/s) (10¹⁸ m/s).

Source

pub fn as_exametres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as exametres per second (Em/s) (10¹⁸ m/s).

Source

pub fn in_Pm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in petametres per second (Pm/s) (10¹⁵ m/s).

Source

pub fn in_petametres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in petametres per second (Pm/s).

Source

pub fn as_Pm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as petametres per second (Pm/s) (10¹⁵ m/s).

Source

pub fn as_petametres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as petametres per second (Pm/s) (10¹⁵ m/s).

Source

pub fn in_Tm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in terametres per second (Tm/s) (10¹² m/s).

Source

pub fn in_terametres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in terametres per second (Tm/s).

Source

pub fn as_Tm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as terametres per second (Tm/s) (10¹² m/s).

Source

pub fn as_terametres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as terametres per second (Tm/s) (10¹² m/s).

Source

pub fn in_Gm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in gigametres per second (Gm/s) (10⁹ m/s).

Source

pub fn in_gigametres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in gigametres per second (Gm/s).

Source

pub fn as_Gm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as gigametres per second (Gm/s) (10⁹ m/s).

Source

pub fn as_gigametres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as gigametres per second (Gm/s) (10⁹ m/s).

Source

pub fn in_Mm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in megametres per second (Mm/s) (10⁶ m/s).

Source

pub fn in_megametres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in megametres per second (Mm/s).

Source

pub fn as_Mm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as megametres per second (Mm/s) (10⁶ m/s).

Source

pub fn as_megametres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as megametres per second (Mm/s) (10⁶ m/s).

Source

pub fn in_km_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in kilometres per second (km/s) (10³ m/s).

Source

pub fn in_kilometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in kilometres per second (km/s).

Source

pub fn as_km_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as kilometres per second (km/s) (10³ m/s).

Source

pub fn as_kilometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as kilometres per second (km/s) (10³ m/s).

Source

pub fn in_hm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in hectometres per second (hm/s) (10² m/s).

Source

pub fn in_hectometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in hectometres per second (hm/s).

Source

pub fn as_hm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as hectometres per second (hm/s) (10² m/s).

Source

pub fn as_hectometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as hectometres per second (hm/s) (10² m/s).

Source

pub fn in_dam_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in dekametres per second (dam/s) (10² m/s).

Source

pub fn in_dekametres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in dekametres per second (dam/s).

Source

pub fn as_dam_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as dekametres per second (dam/s) (10² m/s).

Source

pub fn as_dekametres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as dekametres per second (dam/s) (10² m/s).

Source

pub const fn in_m_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in metres per second (m/s) (base unit, 10⁰ m/s).

Source

pub const fn in_metres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in metres per second (m/s) (base unit, 10⁰ m/s).

Source

pub const fn as_m_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as metres per second (m/s) (base unit, 10⁰ m/s).

Source

pub const fn as_metres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as metres per second (m/s) (base unit, 10⁰ m/s).

Source

pub fn in_dm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in decimetres per second (dm/s) (10⁻¹ m/s).

Source

pub fn in_decimetres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in decimetres per second (dm/s).

Source

pub fn as_dm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as decimetres per second (dm/s) (10⁻¹ m/s).

Source

pub fn as_decimetres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as decimetres per second (dm/s) (10⁻¹ m/s).

Source

pub fn in_cm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in centimetres per second (cm/s) (10⁻² m/s).

Source

pub fn in_centimetres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in centimetres per second (cm/s).

Source

pub fn as_cm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as centimetres per second (cm/s) (10⁻² m/s).

Source

pub fn as_centimetres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as centimetres per second (cm/s) (10⁻² m/s).

Source

pub fn in_mm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in millimetres per second (mm/s) (10⁻³ m/s).

Source

pub fn in_millimetres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in millimetres per second (mm/s).

Source

pub fn as_mm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as millimetres per second (mm/s) (10⁻³ m/s).

Source

pub fn as_millimetres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as millimetres per second (mm/s) (10⁻³ m/s).

Source

pub fn in_um_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in micrometres per second (µm/s) (10⁻⁶ m/s).

Source

pub fn in_micrometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in micrometres per second (µm/s).

Source

pub fn as_um_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as micrometres per second (µm/s) (10⁻⁶ m/s).

Source

pub fn as_micrometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as micrometres per second (µm/s) (10⁻⁶ m/s).

Source

pub fn in_nm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in nanometres per second (nm/s) (10⁻⁹ m/s).

Source

pub fn in_nanometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in nanometres per second (nm/s).

Source

pub fn as_nm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as nanometres per second (nm/s) (10⁻⁹ m/s).

Source

pub fn as_nanometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as nanometres per second (nm/s) (10⁻⁹ m/s).

Source

pub fn in_pm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in picometres per second (pm/s) (10⁻¹² m/s).

Source

pub fn in_picometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in picometres per second (pm/s).

Source

pub fn as_pm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as picometres per second (pm/s) (10⁻¹² m/s).

Source

pub fn as_picometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as picometres per second (pm/s) (10⁻¹² m/s).

Source

pub fn in_fm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in femtometres per second (fm/s) (10⁻¹⁵ m/s).

Source

pub fn in_femtometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in femtometres per second (fm/s).

Source

pub fn as_fm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as femtometres per second (fm/s) (10⁻¹⁵ m/s).

Source

pub fn as_femtometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as femtometres per second (fm/s) (10⁻¹⁵ m/s).

Source

pub fn in_am_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in attometres per second (am/s) (10⁻¹⁸ m/s).

Source

pub fn in_attometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in attometres per second (am/s).

Source

pub fn as_am_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as attometres per second (am/s) (10⁻¹⁸ m/s).

Source

pub fn as_attometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as attometres per second (am/s) (10⁻¹⁸ m/s).

Source

pub fn in_zm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in zeptometres per second (zm/s) (10⁻²¹ m/s).

Source

pub fn in_zeptometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in zeptometres per second (zm/s).

Source

pub fn as_zm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as zeptometres per second (zm/s) (10⁻²¹ m/s).

Source

pub fn as_zeptometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as zeptometres per second (zm/s) (10⁻²¹ m/s).

Source

pub fn in_ym_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in yoctometres per second (ym/s) (10⁻²⁴ m/s).

Source

pub fn in_yoctometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in yoctometres per second (ym/s).

Source

pub fn as_ym_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as yoctometres per second (ym/s) (10⁻²⁴ m/s).

Source

pub fn as_yoctometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as yoctometres per second (ym/s) (10⁻²⁴ m/s).

Source

pub fn in_rm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in rontometres per second (rm/s) (10⁻²⁷ m/s).

Source

pub fn in_rontometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in rontometres per second (rm/s).

Source

pub fn as_rm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as rontometres per second (rm/s) (10⁻²⁷ m/s).

Source

pub fn as_rontometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as rontometres per second (rm/s) (10⁻²⁷ m/s).

Source

pub fn in_qm_s(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in quectometres per second (qm/s) (10⁻³⁰ m/s).

Source

pub fn in_quectometres_second(d: Direction) -> Self

Available on crate feature alloc only.

New Velocity in quectometres per second (qm/s).

Source

pub fn as_qm_s(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as quectometres per second (qm/s) (10⁻³⁰ m/s).

Source

pub fn as_quectometres_second(&self) -> Direction

Available on crate feature alloc only.

Returns Velocity as quectometres per second (qm/s) (10⁻³⁰ m/s).

Trait Implementations§

Source§

impl Clone for Velocity

Available on crate feature alloc only.
Source§

fn clone(&self) -> Velocity

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Velocity

Available on crate feature alloc only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Velocity

Available on crate feature alloc only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Unit for Velocity

Available on crate feature alloc only.
Source§

fn unit() -> String

Returns the unit in short format.
Source§

fn unit_long_s(&self) -> String

Returns the unit in long format, singular.
Source§

fn unit_long_p(&self) -> String

Returns the unit in long format, plural.
Source§

fn unit_long(&self) -> String

Returns the unit in long format, singular if magnitude == 1, plural otherwise.
Source§

fn long(&self) -> String

Returns the unit and magnitude in long format.
Source§

impl Copy for Velocity

Available on crate feature alloc only.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Also for T

Source§

fn also_mut<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Applies a function which takes the parameter by exclusive reference, and then returns the (possibly) modified owned value. Read more
Source§

fn also_ref<F>(self, f: F) -> Self
where F: FnOnce(&Self),

Applies a function which takes the parameter by shared reference, and then returns the (possibly) modified owned value. Read more
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, Res> Apply<Res> for T
where T: ?Sized,

Source§

fn apply<F>(self, f: F) -> Res
where F: FnOnce(Self) -> Res, Self: Sized,

Apply a function which takes the parameter by value.
Source§

fn apply_ref<F>(&self, f: F) -> Res
where F: FnOnce(&Self) -> Res,

Apply a function which takes the parameter by shared reference.
Source§

fn apply_mut<F>(&mut self, f: F) -> Res
where F: FnOnce(&mut Self) -> Res,

Apply a function which takes the parameter by exclusive reference.
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.