Struct geom::Distance [−][src]
pub struct Distance(f64);
Expand description
A distance, in meters. Can be negative.
Tuple Fields
0: f64
Implementations
Creates a distance in centimeters.
Returns the distance in meters. Prefer to work with type-safe Distance
s.
Describes the distance according to formatting rules. Rounds to 1 decimal place for both small (feet and meters) and large (miles and kilometers) units.
Calculates a percentage, usually in [0.0, 1.0], of self / other. If the denominator is zero, returns 0%.
Rounds this distance up to a higher, more “even” value to use for buckets along a plot’s axis. Always rounds for imperial units (feet).
Trait Implementations
Performs the +=
operation. Read more
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the *=
operation. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Performs the -=
operation. Read more
Auto Trait Implementations
impl RefUnwindSafe for Distance
impl UnwindSafe for Distance
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self