pub struct Speed(/* private fields */);Expand description
Speed, stored in knots. Negative is sternway.
Implementations§
Source§impl Speed
impl Speed
Sourcepub fn from_knots(value: f64) -> Result<Self>
pub fn from_knots(value: f64) -> Result<Self>
Sourcepub fn from_metres_per_second(value: f64) -> Result<Self>
pub fn from_metres_per_second(value: f64) -> Result<Self>
Sourcepub fn from_kilometres_per_hour(value: f64) -> Result<Self>
pub fn from_kilometres_per_hour(value: f64) -> Result<Self>
Sourcepub fn metres_per_second(self) -> f64
pub fn metres_per_second(self) -> f64
m/s.
Sourcepub fn kilometres_per_hour(self) -> f64
pub fn kilometres_per_hour(self) -> f64
km/h.
Sourcepub fn is_negative(self) -> bool
pub fn is_negative(self) -> bool
Whether negative (sternway).
Sourcepub fn distance_covered(self, elapsed: Duration) -> Distance
pub fn distance_covered(self, elapsed: Duration) -> Distance
Distance covered in duration.
Sourcepub fn time_to_cover(self, distance: Distance) -> Result<Duration>
pub fn time_to_cover(self, distance: Distance) -> Result<Duration>
Time to cover distance.
§Errors
KernelError::Indeterminate if the speed is zero or of opposite sign
to the distance.
Trait Implementations§
impl Copy for Speed
Source§impl PartialOrd for Speed
impl PartialOrd for Speed
impl StructuralPartialEq for Speed
Auto Trait Implementations§
impl Freeze for Speed
impl RefUnwindSafe for Speed
impl Send for Speed
impl Sync for Speed
impl Unpin for Speed
impl UnsafeUnpin for Speed
impl UnwindSafe for Speed
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