pub struct Distance { /* private fields */ }Implementations§
Source§impl Distance
impl Distance
pub fn from(value: f64, unit: DistanceUnit) -> Self
pub fn from_kilometers(value: f64) -> Self
pub fn from_meters(value: f64) -> Self
pub fn from_miles(value: f64) -> Self
pub fn convert_to(&self, unit: DistanceUnit) -> Self
pub fn in_unit(&self, unit: DistanceUnit) -> f64
pub fn meters(&self) -> f64
pub fn kilometers(&self) -> f64
pub fn miles(&self) -> f64
pub fn to_string(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Distance
impl RefUnwindSafe for Distance
impl Send for Distance
impl Sync for Distance
impl Unpin for Distance
impl UnwindSafe for Distance
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