pub struct Quantity {
pub value: f64,
pub dim: Dim,
}Expand description
A value with a physical dimension, stored in canonical units (mm, rad, s).
Fields§
§value: f64Value in canonical units.
dim: DimDimension.
Implementations§
Source§impl Quantity
impl Quantity
Sourcepub fn length(v: f64, unit: LengthUnit) -> Self
pub fn length(v: f64, unit: LengthUnit) -> Self
Length from a value in unit.
Sourcepub fn checked_add(self, o: Self) -> GeoResult<Self>
pub fn checked_add(self, o: Self) -> GeoResult<Self>
Checked addition (dimensions must match).
Sourcepub fn checked_sub(self, o: Self) -> GeoResult<Self>
pub fn checked_sub(self, o: Self) -> GeoResult<Self>
Checked subtraction.
Trait Implementations§
impl Copy for Quantity
Source§impl<'de> Deserialize<'de> for Quantity
impl<'de> Deserialize<'de> for Quantity
Source§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
impl StructuralPartialEq for Quantity
Auto Trait Implementations§
impl Freeze for Quantity
impl RefUnwindSafe for Quantity
impl Send for Quantity
impl Sync for Quantity
impl Unpin for Quantity
impl UnsafeUnpin for Quantity
impl UnwindSafe for Quantity
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