pub struct LinearUnit { /* private fields */ }Expand description
A coordinate system’s projected linear unit.
The stored value is the conversion factor from one native unit to meters.
Implementations§
Source§impl LinearUnit
impl LinearUnit
Sourcepub const fn meter() -> Self
pub const fn meter() -> Self
Alias for LinearUnit::metre.
Sourcepub const fn kilometer() -> Self
pub const fn kilometer() -> Self
Alias for LinearUnit::kilometre.
Sourcepub const fn us_survey_foot() -> Self
pub const fn us_survey_foot() -> Self
US survey foot-based projected coordinates.
Sourcepub fn from_meters_per_unit(meters_per_unit: f64) -> Result<Self>
pub fn from_meters_per_unit(meters_per_unit: f64) -> Result<Self>
Construct a custom projected linear unit from its meter conversion factor.
Sourcepub const fn meters_per_unit(self) -> f64
pub const fn meters_per_unit(self) -> f64
Return the number of meters represented by one native projected unit.
Sourcepub const fn to_meters(self, value: f64) -> f64
pub const fn to_meters(self, value: f64) -> f64
Convert a native projected coordinate value into meters.
Sourcepub const fn from_meters(self, value: f64) -> f64
pub const fn from_meters(self, value: f64) -> f64
Convert a meter value into the native projected unit.
Trait Implementations§
Source§impl Clone for LinearUnit
impl Clone for LinearUnit
Source§fn clone(&self) -> LinearUnit
fn clone(&self) -> LinearUnit
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LinearUnit
impl Debug for LinearUnit
Source§impl PartialEq for LinearUnit
impl PartialEq for LinearUnit
impl Copy for LinearUnit
impl StructuralPartialEq for LinearUnit
Auto Trait Implementations§
impl Freeze for LinearUnit
impl RefUnwindSafe for LinearUnit
impl Send for LinearUnit
impl Sync for LinearUnit
impl Unpin for LinearUnit
impl UnsafeUnpin for LinearUnit
impl UnwindSafe for LinearUnit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more