Struct sensehat::Pressure [−][src]
pub struct Pressure { /* fields omitted */ }
The Pressure
struct can be used to deal with presssures in a common way.
Common metric and imperial units are supported.
Example
use measurements::Pressure; let earth = Pressure::from_atmospheres(1.0); let mbar = earth.as_millibars(); println!("Atmospheric pressure is {} mbar.", mbar);
Methods
impl Pressure
[src]
impl Pressure
pub fn from_pascals(pascals: f64) -> Pressure
[src]
pub fn from_pascals(pascals: f64) -> Pressure
Create new Pressure from floating point value in Pascals (Pa)
pub fn from_hectopascals(hectopascals: f64) -> Pressure
[src]
pub fn from_hectopascals(hectopascals: f64) -> Pressure
Create new Pressure from floating point value in hectopascals (hPA)
pub fn from_millibars(millibars: f64) -> Pressure
[src]
pub fn from_millibars(millibars: f64) -> Pressure
Create new Pressure from floating point value in millibars (mBar)
pub fn from_kilopascals(kilopascals: f64) -> Pressure
[src]
pub fn from_kilopascals(kilopascals: f64) -> Pressure
Create new Pressure from floating point value in kilopascals (kPa)
pub fn from_psi(psi: f64) -> Pressure
[src]
pub fn from_psi(psi: f64) -> Pressure
Create new Pressure from floating point value in psi
pub fn from_bars(bars: f64) -> Pressure
[src]
pub fn from_bars(bars: f64) -> Pressure
Create new Pressure from floating point value in Bar
pub fn from_atmospheres(atmospheres: f64) -> Pressure
[src]
pub fn from_atmospheres(atmospheres: f64) -> Pressure
Create new Pressure from floating point value in Atmospheres
pub fn as_pascals(&self) -> f64
[src]
pub fn as_pascals(&self) -> f64
Convert this Pressure into a floating point value in Pascals
pub fn as_hectopascals(&self) -> f64
[src]
pub fn as_hectopascals(&self) -> f64
Convert this Pressure into a floating point value in hectopascals (hPA)
pub fn as_millibars(&self) -> f64
[src]
pub fn as_millibars(&self) -> f64
Convert this Pressure into a floating point value in millibars (mBar)
pub fn as_kilopascals(&self) -> f64
[src]
pub fn as_kilopascals(&self) -> f64
Convert this Pressure into a floating point value in kilopascals (kPA)
pub fn as_psi(&self) -> f64
[src]
pub fn as_psi(&self) -> f64
Convert this Pressure into a floating point value in pounds per square-inch (psi)
pub fn as_bars(&self) -> f64
[src]
pub fn as_bars(&self) -> f64
Convert this Pressure into a floating point value in Bar
pub fn as_atmospheres(&self) -> f64
[src]
pub fn as_atmospheres(&self) -> f64
Convert this Pressure into a floating point value in Atmospheres
Trait Implementations
impl Add<Pressure> for Pressure
[src]
impl Add<Pressure> for Pressure
type Output = Pressure
The resulting type after applying the +
operator.
fn add(self, rhs: Pressure) -> Pressure
[src]
fn add(self, rhs: Pressure) -> Pressure
Performs the +
operation.
impl PartialOrd<Pressure> for Pressure
[src]
impl PartialOrd<Pressure> for Pressure
fn partial_cmp(&self, other: &Pressure) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Pressure) -> Option<Ordering>
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]
fn lt(&self, other: &Rhs) -> bool
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]
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
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
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]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Sub<Pressure> for Pressure
[src]
impl Sub<Pressure> for Pressure
type Output = Pressure
The resulting type after applying the -
operator.
fn sub(self, rhs: Pressure) -> Pressure
[src]
fn sub(self, rhs: Pressure) -> Pressure
Performs the -
operation.
impl Display for Pressure
[src]
impl Display for Pressure
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Clone for Pressure
[src]
impl Clone for Pressure
fn clone(&self) -> Pressure
[src]
fn clone(&self) -> Pressure
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Pressure
[src]
impl Debug for Pressure
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Mul<Pressure> for Area
[src]
impl Mul<Pressure> for Area
type Output = Force
The resulting type after applying the *
operator.
fn mul(self, rhs: Pressure) -> <Area as Mul<Pressure>>::Output
[src]
fn mul(self, rhs: Pressure) -> <Area as Mul<Pressure>>::Output
Performs the *
operation.
impl Mul<Area> for Pressure
[src]
impl Mul<Area> for Pressure
type Output = Force
The resulting type after applying the *
operator.
fn mul(self, rhs: Area) -> <Pressure as Mul<Area>>::Output
[src]
fn mul(self, rhs: Area) -> <Pressure as Mul<Area>>::Output
Performs the *
operation.
impl Mul<Pressure> for f64
[src]
impl Mul<Pressure> for f64
type Output = Pressure
The resulting type after applying the *
operator.
fn mul(self, rhs: Pressure) -> Pressure
[src]
fn mul(self, rhs: Pressure) -> Pressure
Performs the *
operation.
impl Mul<f64> for Pressure
[src]
impl Mul<f64> for Pressure
type Output = Pressure
The resulting type after applying the *
operator.
fn mul(self, rhs: f64) -> Pressure
[src]
fn mul(self, rhs: f64) -> Pressure
Performs the *
operation.
impl Copy for Pressure
[src]
impl Copy for Pressure
impl Eq for Pressure
[src]
impl Eq for Pressure
impl PartialEq<Pressure> for Pressure
[src]
impl PartialEq<Pressure> for Pressure
fn eq(&self, other: &Pressure) -> bool
[src]
fn eq(&self, other: &Pressure) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Measurement for Pressure
[src]
impl Measurement for Pressure
fn as_base_units(&self) -> f64
[src]
fn as_base_units(&self) -> f64
Get this quantity in the base units
fn from_base_units(units: f64) -> Pressure
[src]
fn from_base_units(units: f64) -> Pressure
Create a new quantity from the base units
fn get_base_units_name(&self) -> &'static str
[src]
fn get_base_units_name(&self) -> &'static str
Return the base unit for this type, as a string. For example "kilograms" Read more
fn get_appropriate_units(&self) -> (&'static str, f64)
[src]
fn get_appropriate_units(&self) -> (&'static str, f64)
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]
fn pick_appropriate_units(
&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 Div<f64> for Pressure
[src]
impl Div<f64> for Pressure
type Output = Pressure
The resulting type after applying the /
operator.
fn div(self, rhs: f64) -> Pressure
[src]
fn div(self, rhs: f64) -> Pressure
Performs the /
operation.
impl Div<Pressure> for Force
[src]
impl Div<Pressure> for Force
type Output = Area
The resulting type after applying the /
operator.
fn div(self, rhs: Pressure) -> <Force as Div<Pressure>>::Output
[src]
fn div(self, rhs: Pressure) -> <Force as Div<Pressure>>::Output
Performs the /
operation.
impl Div<Pressure> for Pressure
[src]
impl Div<Pressure> for Pressure