Expand description
Quantity of speed.
Speed is a derived quantity with length units and time units.
Operations
- Length
*
Frequency=>
Speed - Length
/
time unit=>
Speed - Length
/
Period=>
Speed - Speed
+
Speed=>
Speed - Speed
-
Speed=>
Speed - Speed
*
f64=>
Speed - f64
*
Speed=>
Speed - i32
*
Speed=>
Speed - Speed
/
f64=>
Speed
Units must be the same for operations with two Speed operands. The to method can be used for conversion.
Example
use mag::{Speed, length::{m, mi}, time::{h, s}};
let a = 7.4 * m / s;
let b = 55 * mi / h;
assert_eq!(a.to_string(), "7.4 m/s");
assert_eq!(b.to_string(), "55 mi/h");
Fields
quantity: f64
Speed quantity
Implementations
Trait Implementations
sourceimpl<L: PartialEq, P: PartialEq> PartialEq<Speed<L, P>> for Speed<L, P> where
L: Unit,
P: Unit,
impl<L: PartialEq, P: PartialEq> PartialEq<Speed<L, P>> for Speed<L, P> where
L: Unit,
P: Unit,
sourceimpl<L: PartialOrd, P: PartialOrd> PartialOrd<Speed<L, P>> for Speed<L, P> where
L: Unit,
P: Unit,
impl<L: PartialOrd, P: PartialOrd> PartialOrd<Speed<L, P>> for Speed<L, P> where
L: Unit,
P: Unit,
sourcefn partial_cmp(&self, other: &Speed<L, P>) -> Option<Ordering>
fn partial_cmp(&self, other: &Speed<L, P>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<L: Copy, P: Copy> Copy for Speed<L, P> where
L: Unit,
P: Unit,
impl<L, P> StructuralPartialEq for Speed<L, P> where
L: Unit,
P: Unit,
Auto Trait Implementations
impl<L, P> RefUnwindSafe for Speed<L, P> where
L: RefUnwindSafe,
P: RefUnwindSafe,
impl<L, P> Send for Speed<L, P> where
L: Send,
P: Send,
impl<L, P> Sync for Speed<L, P> where
L: Sync,
P: Sync,
impl<L, P> Unpin for Speed<L, P> where
L: Unpin,
P: Unpin,
impl<L, P> UnwindSafe for Speed<L, P> where
L: UnwindSafe,
P: UnwindSafe,
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more