Struct measurements::area::Area
[−]
[src]
pub struct Area { /* fields omitted */ }
The Area
struct can be used to deal with areas in a common way.
Common metric and imperial units are supported.
Example
use measurements::Area; let football_field = Area::from_square_meters(7140.0); let acres = football_field.as_acres(); println!("There are {} acres in a football field.", acres);
Methods
impl Area
[src]
pub fn from_square_meters(square_meters: f64) -> Self
[src]
Create new area from floating point value in Square Meters
pub fn from_square_metres(square_metres: f64) -> Self
[src]
Create new area from floating point value in Square Metres
pub fn from_square_nanometers(square_nanometers: f64) -> Self
[src]
Create new area from floating point value in Square Nanometers
pub fn from_square_nanometres(square_nanometres: f64) -> Self
[src]
Create new area from floating point value in Square Nanometres
pub fn from_square_micrometers(square_micrometers: f64) -> Self
[src]
Create new area from floating point value in Square Micrometers
pub fn from_square_micrometres(square_micrometres: f64) -> Self
[src]
Create new area from floating point value in Square Micrometres
pub fn from_square_millimeters(square_millimeters: f64) -> Self
[src]
Create new area from floating point value in Square Millimeters
pub fn from_square_millimetres(square_millimetres: f64) -> Self
[src]
Create new area from floating point value in Square Millimetres
pub fn from_square_centimeters(square_centimeters: f64) -> Self
[src]
Create new area from floating point value in Square Centimeters
pub fn from_square_centimetres(square_centimetres: f64) -> Self
[src]
Create new area from floating point value in Square Centimetres
pub fn from_square_decimeters(square_decimeters: f64) -> Self
[src]
Create new area from floating point value in Square Decimeters
pub fn from_square_decimetres(square_decimetres: f64) -> Self
[src]
Create new area from floating point value in Square Decimetres
pub fn from_square_hectometers(square_hectometers: f64) -> Self
[src]
Create new area from floating point value in Square Hectometers
pub fn from_square_hectometres(square_hectometres: f64) -> Self
[src]
Create new area from floating point value in Square Hectometres
pub fn from_hectares(hectares: f64) -> Self
[src]
Create new area from floating point value in Hectares
pub fn from_square_kilometers(square_kilometers: f64) -> Self
[src]
Create new area from floating point value in Square Kilometers
pub fn from_square_kilometres(square_kilometres: f64) -> Self
[src]
Create new area from floating point value in Square Kilometres
pub fn from_square_inches(square_inches: f64) -> Self
[src]
Create new area from floating point value in Square Inches
pub fn from_square_feet(square_feet: f64) -> Self
[src]
Create new area from floating point value in Square Feet
pub fn from_square_yards(square_yards: f64) -> Self
[src]
Create new area from floating point value in Square Yards
pub fn from_acres(acres: f64) -> Self
[src]
Create new area from floating point value in Acres
pub fn from_square_miles(square_miles: f64) -> Self
[src]
Create new area from floating point value in Square Miles
pub fn as_square_nanometers(&self) -> f64
[src]
Convert this Area to a floating point value in Square Nanometers
pub fn as_square_nanometres(&self) -> f64
[src]
Convert this Area to a floating point value in Square Nanometres
pub fn as_square_micrometers(&self) -> f64
[src]
Convert this Area to a floating point value in Square Micrometers
pub fn as_square_micrometres(&self) -> f64
[src]
Convert this Area to a floating point value in Square Micrometres
pub fn as_square_millimeters(&self) -> f64
[src]
Convert this Area to a floating point value in Square Millimeters
pub fn as_square_millimetres(&self) -> f64
[src]
Convert this Area to a floating point value in Square Millimetres
pub fn as_square_centimeters(&self) -> f64
[src]
Convert this Area to a floating point value in Square Centimeters
pub fn as_square_centimetres(&self) -> f64
[src]
Convert this Area to a floating point value in Square Centimetres
pub fn as_square_meters(&self) -> f64
[src]
Convert this Area to a floating point value in Square Meters
pub fn as_square_metres(&self) -> f64
[src]
Convert this Area to a floating point value in Square Metres
pub fn as_square_decimeters(&self) -> f64
[src]
Convert this Area to a floating point value in Square Decimeters
pub fn as_square_decimetres(&self) -> f64
[src]
Convert this Area to a floating point value in Square Decimetres
pub fn as_square_hectometers(&self) -> f64
[src]
Convert this Area to a floating point value in Square Hectometers
pub fn as_square_hectometres(&self) -> f64
[src]
Convert this Area to a floating point value in Square Hectometres
pub fn as_hectares(&self) -> f64
[src]
Convert this Area to a floating point value in Hectares
pub fn as_square_kilometers(&self) -> f64
[src]
Convert this Area to a floating point value in Square Kilometers
pub fn as_square_kilometres(&self) -> f64
[src]
Convert this Area to a floating point value in Square Kilometres
pub fn as_square_inches(&self) -> f64
[src]
Convert this Area to a floating point value in Square Inches
pub fn as_square_feet(&self) -> f64
[src]
Convert this Area to a floating point value in Square Feet
pub fn as_square_yards(&self) -> f64
[src]
Convert this Area to a floating point value in Square Yards
pub fn as_acres(&self) -> f64
[src]
Convert this Area to a floating point value in Acres
pub fn as_square_miles(&self) -> f64
[src]
Convert this Area to a floating point value in Square Miles
Trait Implementations
impl Copy for Area
[src]
impl Clone for Area
[src]
fn clone(&self) -> Area
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Area
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Measurement for Area
[src]
fn as_base_units(&self) -> f64
[src]
Get this quantity in the base units
fn from_base_units(units: f64) -> Self
[src]
Create a new quantity from the base units
fn get_base_units_name(&self) -> &'static str
[src]
Return the base unit for this type, as a string. For example "kilograms" Read more
fn get_appropriate_units(&self) -> (&'static str, f64)
[src]
Returns a string containing the most appropriate units for this quantity, and a floating point value representing this quantity in those units. Useful when, for example, a length might be in millimeters if it is very small, or kilometers when it is very large. Read more
fn pick_appropriate_units(
&self,
list: &[(&'static str, f64)]
) -> (&'static str, f64)
[src]
&self,
list: &[(&'static str, f64)]
) -> (&'static str, f64)
Given a list of units and their scale relative to the base unit, select the most appropriate one. Read more
impl Display for Area
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Add for Area
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
Performs the +
operation.
impl Sub for Area
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
Performs the -
operation.
impl Div<Area> for Area
[src]
type Output = f64
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> f64
[src]
Performs the /
operation.
impl Div<f64> for Area
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: f64) -> Self
[src]
Performs the /
operation.
impl Mul<f64> for Area
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: f64) -> Self
[src]
Performs the *
operation.
impl Mul<Area> for f64
[src]
type Output = Area
The resulting type after applying the *
operator.
fn mul(self, rhs: Area) -> Area
[src]
Performs the *
operation.
impl Eq for Area
[src]
impl PartialEq for Area
[src]
fn eq(&self, other: &Self) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialOrd for Area
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Div<Length> for Area
[src]
type Output = Length
The resulting type after applying the /
operator.
fn div(self, rhs: Length) -> Self::Output
[src]
Performs the /
operation.
impl Mul<Pressure> for Area
[src]
type Output = Force
The resulting type after applying the *
operator.
fn mul(self, rhs: Pressure) -> Self::Output
[src]
Performs the *
operation.
impl Mul<Area> for Pressure
[src]
type Output = Force
The resulting type after applying the *
operator.
fn mul(self, rhs: Area) -> Self::Output
[src]
Performs the *
operation.
impl Div<Area> for Force
[src]
type Output = Pressure
The resulting type after applying the /
operator.
fn div(self, rhs: Area) -> Self::Output
[src]
Performs the /
operation.
impl Mul<Length> for Area
[src]
type Output = Volume
The resulting type after applying the *
operator.
fn mul(self, rhs: Length) -> Self::Output
[src]
Performs the *
operation.
impl Mul<Area> for Length
[src]
type Output = Volume
The resulting type after applying the *
operator.
fn mul(self, rhs: Area) -> Self::Output
[src]
Performs the *
operation.