Expand description
Two dimensional area.
Area is a derived quantity with a specific unit squared.
Operations
- Area
+
Area=>
Area - Area
-
Area=>
Area - Area
*
f64=>
Area - Area
*
Length=>
Volume - Area
/
f64=>
Area - Area
/
Length=>
Length
Example
use mag::length::m;
let a = 150.0 * m * m; // Area<m>
let b = 10.0 * m * 15.0 * m; // Area<m>
assert_eq!(a, b);
assert_eq!(a.to_string(), "150 m²");
assert_eq!(a / (5.0 * m), 30.0 * m);
Fields
quantity: f64
Area quantity
Implementations
Trait Implementations
sourceimpl<U: PartialOrd> PartialOrd<Area<U>> for Area<U> where
U: Unit,
impl<U: PartialOrd> PartialOrd<Area<U>> for Area<U> where
U: Unit,
sourcefn partial_cmp(&self, other: &Area<U>) -> Option<Ordering>
fn partial_cmp(&self, other: &Area<U>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<U: Copy> Copy for Area<U> where
U: Unit,
impl<U> StructuralPartialEq for Area<U> where
U: Unit,
Auto Trait Implementations
impl<U> RefUnwindSafe for Area<U> where
U: RefUnwindSafe,
impl<U> Send for Area<U> where
U: Send,
impl<U> Sync for Area<U> where
U: Sync,
impl<U> Unpin for Area<U> where
U: Unpin,
impl<U> UnwindSafe for Area<U> where
U: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more