[−][src]Struct mag::Speed
A measurement of speed.
Speed is a derived quantity with length units and time units.
Operations
- Speed
+
Speed=>
Speed - Speed
-
Speed=>
Speed - Speed
*
f64=>
Speed - f64
*
Speed=>
Speed - Length
*
Frequency=>
Speed - Speed
/
f64=>
Speed - Length
/
time unit=>
Speed - Length
/
Period=>
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.0 * mi / h; assert_eq!(a.to_string(), "7.4 m/s"); assert_eq!(b.to_string(), "55 mi/h");
Fields
quantity: f64
Speed quantity
Methods
impl<L, P> Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
pub fn new(quantity: f64) -> Self
[src]
Create a new length measurement
pub fn to<N, R>(self) -> Speed<N, R> where
N: Unit,
R: Unit,
[src]
N: Unit,
R: Unit,
Convert to specified units
Trait Implementations
impl<L: Clone, P: Clone> Clone for Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
impl<L: Copy, P: Copy> Copy for Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
impl<L: PartialEq, P: PartialEq> PartialEq<Speed<L, P>> for Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
impl<L, P> Display for Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
impl<L: Debug, P: Debug> Debug for Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
impl<L, P> Div<f64> for Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
type Output = Self
The resulting type after applying the /
operator.
fn div(self, scalar: f64) -> Self::Output
[src]
impl<L, P> Sub<Speed<L, P>> for Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
impl<L, P> Add<Speed<L, P>> for Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self::Output
[src]
impl<L, P> Mul<f64> for Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, scalar: f64) -> Self::Output
[src]
impl<L, P> Mul<Speed<L, P>> for f64 where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
type Output = Speed<L, P>
The resulting type after applying the *
operator.
fn mul(self, other: Speed<L, P>) -> Self::Output
[src]
impl<L, P> StructuralPartialEq for Speed<L, P> where
L: Unit,
P: Unit,
[src]
L: Unit,
P: Unit,
Auto Trait Implementations
impl<L, P> Send for Speed<L, P> where
L: Send,
P: Send,
L: Send,
P: Send,
impl<L, P> Sync for Speed<L, P> where
L: Sync,
P: Sync,
L: Sync,
P: Sync,
impl<L, P> Unpin for Speed<L, P> where
L: Unpin,
P: Unpin,
L: Unpin,
P: Unpin,
impl<L, P> UnwindSafe for Speed<L, P> where
L: UnwindSafe,
P: UnwindSafe,
L: UnwindSafe,
P: UnwindSafe,
impl<L, P> RefUnwindSafe for Speed<L, P> where
L: RefUnwindSafe,
P: RefUnwindSafe,
L: RefUnwindSafe,
P: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,