#[non_exhaustive]pub enum Area {
Hectare,
Decare,
Are,
Deciare,
Centiare,
Barn,
Acre,
}Expand description
A unit of area.
Measurements of area are of the same kind as measurements of length with power 2. Thus, any measurement created with an area unit can be converted to a a length unit squared, and vice versa.
The listed abbreviations are the abbreviations used to parse the unit with
FromStr. The main abbreviation comes first, followed by any alternate
abbreviations that can be used.
The conversions are listed in terms of the base unit. The base unit for
Area is Area::Are.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Hectare
-
Abbreviation:
ha -
1 ha = 100.0 a
Decare
-
Abbreviation:
daa -
1 daa = 10.0 a
Are
-
Abbreviation:
a -
1 a = 1.0 a
Deciare
-
Abbreviation:
da -
1 da = 0.1 a
Centiare
-
Abbreviation:
ca -
1 ca = 0.01 a
Barn
-
Abbreviation:
b -
1 b = 1e-30 a
Acre
-
Abbreviation:
ac -
1 ac = 40.468564224 a
Implementations§
Trait Implementations§
Source§impl Convert for Area
impl Convert for Area
Source§fn conversion_factor(&self) -> f64
fn conversion_factor(&self) -> f64
Returns the conversion factor from
&self to Convert::BASE, i.e. the value to multiply
a quantity in this unit by, in order to get a quantity in Convert::BASE. If the self
unit is the same as this unit, then this function should return 1.0. Read moreSource§fn conversion_factor_to(&self, target: impl Into<Unit>) -> Option<f64>
fn conversion_factor_to(&self, target: impl Into<Unit>) -> Option<f64>
Defines the conversion factor from
Convert::BASE, to a base unit that Convert::BASE
is derived from. Returns None if there is no conversion factor, meaning the two units
are unrelated. Read moreSource§impl From<Area> for CompoundUnit
impl From<Area> for CompoundUnit
impl Copy for Area
impl Eq for Area
impl StructuralPartialEq 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