[−][src]Struct mag::Area
A measurement of physical 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
Methods
impl<U> Area<U> where
U: Unit,
[src]
U: Unit,
pub fn new(quantity: f64) -> Self
[src]
Create a new area measurement
pub fn to<T: Unit>(self) -> Area<T>
[src]
Convert to specified units
Trait Implementations
impl<U: Clone> Clone for Area<U> where
U: Unit,
[src]
U: Unit,
impl<U: Copy> Copy for Area<U> where
U: Unit,
[src]
U: Unit,
impl<U: PartialEq> PartialEq<Area<U>> for Area<U> where
U: Unit,
[src]
U: Unit,
impl<U> Display for Area<U> where
U: Unit,
[src]
U: Unit,
impl<U: Debug> Debug for Area<U> where
U: Unit,
[src]
U: Unit,
impl<U> Div<f64> for Area<U> where
U: Unit,
[src]
U: Unit,
type Output = Self
The resulting type after applying the /
operator.
fn div(self, scalar: f64) -> Self::Output
[src]
impl<U> Div<Length<U>> for Area<U> where
U: Unit,
[src]
U: Unit,
type Output = Length<U>
The resulting type after applying the /
operator.
fn div(self, other: Length<U>) -> Self::Output
[src]
impl<U> Div<Area<U>> for Volume<U> where
U: Unit,
[src]
U: Unit,
type Output = Length<U>
The resulting type after applying the /
operator.
fn div(self, other: Area<U>) -> Self::Output
[src]
impl<U> Sub<Area<U>> for Area<U> where
U: Unit,
[src]
U: Unit,
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
impl<U> Add<Area<U>> for Area<U> where
U: Unit,
[src]
U: Unit,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self::Output
[src]
impl Mul<km> for Area<km>
[src]
type Output = Volume<km>
The resulting type after applying the *
operator.
fn mul(self, _unit: km) -> Self::Output
[src]
impl Mul<m> for Area<m>
[src]
type Output = Volume<m>
The resulting type after applying the *
operator.
fn mul(self, _unit: m) -> Self::Output
[src]
impl Mul<dm> for Area<dm>
[src]
type Output = Volume<dm>
The resulting type after applying the *
operator.
fn mul(self, _unit: dm) -> Self::Output
[src]
impl Mul<cm> for Area<cm>
[src]
type Output = Volume<cm>
The resulting type after applying the *
operator.
fn mul(self, _unit: cm) -> Self::Output
[src]
impl Mul<mm> for Area<mm>
[src]
type Output = Volume<mm>
The resulting type after applying the *
operator.
fn mul(self, _unit: mm) -> Self::Output
[src]
impl Mul<um> for Area<um>
[src]
type Output = Volume<um>
The resulting type after applying the *
operator.
fn mul(self, _unit: um) -> Self::Output
[src]
impl Mul<nm> for Area<nm>
[src]
type Output = Volume<nm>
The resulting type after applying the *
operator.
fn mul(self, _unit: nm) -> Self::Output
[src]
impl Mul<mi> for Area<mi>
[src]
type Output = Volume<mi>
The resulting type after applying the *
operator.
fn mul(self, _unit: mi) -> Self::Output
[src]
impl Mul<ft> for Area<ft>
[src]
type Output = Volume<ft>
The resulting type after applying the *
operator.
fn mul(self, _unit: ft) -> Self::Output
[src]
impl Mul<In> for Area<In>
[src]
type Output = Volume<In>
The resulting type after applying the *
operator.
fn mul(self, _unit: In) -> Self::Output
[src]
impl Mul<yd> for Area<yd>
[src]
type Output = Volume<yd>
The resulting type after applying the *
operator.
fn mul(self, _unit: yd) -> Self::Output
[src]
impl<U> Mul<f64> for Area<U> where
U: Unit,
[src]
U: Unit,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, scalar: f64) -> Self::Output
[src]
impl<U> Mul<Area<U>> for f64 where
U: Unit,
[src]
U: Unit,
type Output = Area<U>
The resulting type after applying the *
operator.
fn mul(self, other: Area<U>) -> Self::Output
[src]
impl<U> Mul<Length<U>> for Area<U> where
U: Unit,
[src]
U: Unit,
type Output = Volume<U>
The resulting type after applying the *
operator.
fn mul(self, other: Length<U>) -> Self::Output
[src]
impl<U> StructuralPartialEq for Area<U> where
U: Unit,
[src]
U: Unit,
Auto Trait Implementations
impl<U> Send for Area<U> where
U: Send,
U: Send,
impl<U> Sync for Area<U> where
U: Sync,
U: Sync,
impl<U> Unpin for Area<U> where
U: Unpin,
U: Unpin,
impl<U> UnwindSafe for Area<U> where
U: UnwindSafe,
U: UnwindSafe,
impl<U> RefUnwindSafe for Area<U> where
U: RefUnwindSafe,
U: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,