Struct geom::Distance [−][src]
A distance, in meters. Can be negative.
Implementations
impl Distance
[src]
pub const ZERO: Distance
[src]
pub fn meters(value: f64) -> Distance
[src]
Creates a distance in meters.
pub const fn const_meters(value: f64) -> Distance
[src]
pub fn inches(value: f64) -> Distance
[src]
Creates a distance in inches.
pub fn miles(value: f64) -> Distance
[src]
Creates a distance in miles.
pub fn centimeters(value: usize) -> Distance
[src]
Creates a distance in centimeters.
pub fn abs(self) -> Distance
[src]
Returns the absolute value of this distance.
pub fn sqrt(self) -> Distance
[src]
Returns the square root of this distance.
pub fn inner_meters(self) -> f64
[src]
Returns the distance in meters. Prefer to work with type-safe Distance
s.
pub fn to_feet(self) -> f64
[src]
Returns the distance in feet.
pub fn to_string(self, fmt: &UnitFmt) -> String
[src]
Describes the distance according to formatting rules.
Trait Implementations
impl Add<Distance> for Distance
[src]
type Output = Distance
The resulting type after applying the +
operator.
fn add(self, other: Distance) -> Distance
[src]
impl AddAssign<Distance> for Distance
[src]
fn add_assign(&mut self, other: Distance)
[src]
impl Clone for Distance
[src]
impl Copy for Distance
[src]
impl Debug for Distance
[src]
impl Default for Distance
[src]
impl<'de> Deserialize<'de> for Distance
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Distance
[src]
impl Div<Distance> for Distance
[src]
type Output = f64
The resulting type after applying the /
operator.
fn div(self, other: Distance) -> f64
[src]
impl Div<Speed> for Distance
[src]
type Output = Duration
The resulting type after applying the /
operator.
fn div(self, other: Speed) -> Duration
[src]
impl Div<f64> for Distance
[src]
type Output = Distance
The resulting type after applying the /
operator.
fn div(self, scalar: f64) -> Distance
[src]
impl Eq for Distance
[src]
impl Mul<f64> for Distance
[src]
type Output = Distance
The resulting type after applying the *
operator.
fn mul(self, scalar: f64) -> Distance
[src]
impl Neg for Distance
[src]
type Output = Distance
The resulting type after applying the -
operator.
fn neg(self) -> Distance
[src]
impl Ord for Distance
[src]
fn cmp(&self, other: &Distance) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Distance> for Distance
[src]
impl PartialOrd<Distance> for Distance
[src]
fn partial_cmp(&self, other: &Distance) -> Option<Ordering>
[src]
fn lt(&self, other: &Distance) -> bool
[src]
fn le(&self, other: &Distance) -> bool
[src]
fn gt(&self, other: &Distance) -> bool
[src]
fn ge(&self, other: &Distance) -> bool
[src]
impl Serialize for Distance
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Distance
[src]
impl Sub<Distance> for Distance
[src]
type Output = Distance
The resulting type after applying the -
operator.
fn sub(self, other: Distance) -> Distance
[src]
impl SubAssign<Distance> for Distance
[src]
fn sub_assign(&mut self, other: Distance)
[src]
impl Sum<Distance> for Distance
[src]
Auto Trait Implementations
impl RefUnwindSafe for Distance
[src]
impl Send for Distance
[src]
impl Sync for Distance
[src]
impl Unpin for Distance
[src]
impl UnwindSafe for Distance
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,