pub struct Area { /* private fields */ }Expand description
The quantity expressing the extent of a two-dimensional region.
Definition: Length²
Reference unit: Square Meter (‘m²’)
Predefined units:
| Symbol | Name | Definition | Equivalent in ‘m²’ |
|---|---|---|---|
| mm² | Square Millimeter | mm² | 0.000001 |
| cm² | Square Centimeter | cm² | 0.0001 |
| in² | Square Inch | in² | 0.00064516 |
| dm² | Square Decimeter | dm² | 0.01 |
| ft² | Square Foot | ft² | 0.09290304 |
| yd² | Square Yard | yd² | 0.83612736 |
| a | Are | 100·m² | 100 |
| ac | Acre | 4840·yd² | 4046.8564224 |
| ha | Hectare | 100·a | 10000 |
| km² | Square Kilometer | km² | 1000000 |
| mi² | Square Mile | mi² | 2589988.110336 |
Trait Implementations§
Source§impl HasRefUnit for Area
impl HasRefUnit for Area
Source§const REF_UNIT: AreaUnit = AreaUnit::SquareMeter
const REF_UNIT: AreaUnit = AreaUnit::SquareMeter
Unit used as reference for scaling the units of
Self::UnitType.Source§fn unit_from_scale(amnt: AmountT) -> Option<Self::UnitType>
fn unit_from_scale(amnt: AmountT) -> Option<Self::UnitType>
Returns
Some(unit) where unit.scale() == amnt, or None if
there is no such unit.Source§fn equiv_amount(&self, unit: Self::UnitType) -> AmountT
fn equiv_amount(&self, unit: Self::UnitType) -> AmountT
Returns
factor so that factor * unit == self.Source§fn convert(&self, to_unit: Self::UnitType) -> Self
fn convert(&self, to_unit: Self::UnitType) -> Self
Returns
qty where qty == self and qty.unit() is to_unit.Source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
Returns true, if
self and other have equivalent amounts, otherwise
false.Source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Returns the partial order of
selfs amount and others eqivalent
amount in selfs unit.Source§impl PartialOrd for Area
impl PartialOrd for Area
Source§impl Quantity for Area
impl Quantity for Area
Source§fn new(amount: AmountT, unit: Self::UnitType) -> Self
fn new(amount: AmountT, unit: Self::UnitType) -> Self
Returns a new instance of the type implementing
Quantity.Source§fn iter_units() -> impl Iterator<Item = Self::UnitType>
fn iter_units() -> impl Iterator<Item = Self::UnitType>
Returns an iterator over the variants of
Self::UnitType.Source§fn unit_from_symbol(symbol: &str) -> Option<Self::UnitType>
fn unit_from_symbol(symbol: &str) -> Option<Self::UnitType>
Returns
Some(unit) where unit.symbol() == symbol, or None if
there is no such unit.Source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
Return
true if self and other have the same unit and their
amounts are equal, otherwise false.Source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Returns the partial order of
selfs and others amounts, if both
have the same unit, otherwise None.impl Copy for Area
impl Eq for Area
Auto Trait Implementations§
impl Freeze for Area
impl RefUnwindSafe for Area
impl Send for Area
impl Sync for Area
impl Unpin for Area
impl UnwindSafe for Area
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