pub struct Speed<L, P>{
pub quantity: f64,
/* private fields */
}
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§
Source§impl<L, P> PartialOrd for Speed<L, P>
impl<L, P> PartialOrd for Speed<L, P>
impl<L, P> Copy for Speed<L, P>
impl<L, P> StructuralPartialEq for Speed<L, P>
Auto Trait Implementations§
impl<L, P> Freeze for Speed<L, P>
impl<L, P> RefUnwindSafe for Speed<L, P>where
L: RefUnwindSafe,
P: RefUnwindSafe,
impl<L, P> Send for Speed<L, P>
impl<L, P> Sync for Speed<L, P>
impl<L, P> Unpin for Speed<L, P>
impl<L, P> UnwindSafe for Speed<L, P>where
L: UnwindSafe,
P: UnwindSafe,
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