[][src]Struct mag::Speed

pub struct Speed<L, P> where
    L: Unit,
    P: Unit
{ pub quantity: f64, // some fields omitted }

A measurement of speed.

Speed is a derived quantity with length units and time units.

Operations

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]

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]

Convert to specified units

Trait Implementations

impl<L: Clone, P: Clone> Clone for Speed<L, P> where
    L: Unit,
    P: Unit
[src]

impl<L: Copy, P: Copy> Copy for Speed<L, P> where
    L: Unit,
    P: Unit
[src]

impl<L: PartialEq, P: PartialEq> PartialEq<Speed<L, P>> for Speed<L, P> where
    L: Unit,
    P: Unit
[src]

impl<L, P> Display for Speed<L, P> where
    L: Unit,
    P: Unit
[src]

impl<L: Debug, P: Debug> Debug for Speed<L, P> where
    L: Unit,
    P: Unit
[src]

impl<L, P> Div<f64> for Speed<L, P> where
    L: Unit,
    P: Unit
[src]

type Output = Self

The resulting type after applying the / operator.

impl<L, P> Sub<Speed<L, P>> for Speed<L, P> where
    L: Unit,
    P: Unit
[src]

type Output = Self

The resulting type after applying the - operator.

impl<L, P> Add<Speed<L, P>> for Speed<L, P> where
    L: Unit,
    P: Unit
[src]

type Output = Self

The resulting type after applying the + operator.

impl<L, P> Mul<f64> for Speed<L, P> where
    L: Unit,
    P: Unit
[src]

type Output = Self

The resulting type after applying the * operator.

impl<L, P> Mul<Speed<L, P>> for f64 where
    L: Unit,
    P: Unit
[src]

type Output = Speed<L, P>

The resulting type after applying the * operator.

impl<L, P> StructuralPartialEq for Speed<L, P> where
    L: Unit,
    P: Unit
[src]

Auto Trait Implementations

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

impl<L, P> RefUnwindSafe for Speed<L, P> where
    L: RefUnwindSafe,
    P: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]