[][src]Trait metfor::Quantity

pub trait Quantity: Copy + Debug + Sized {
    fn pack(_: f64) -> Self;
fn unpack(self) -> f64;
fn unwrap(self) -> f64;
fn into_option(self) -> Option<f64>; fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool
    where
        Self: From<RHS> + From<TOL> + Quantity
, { ... }
fn abs(self) -> Self { ... } }

A quantity is a common super trait for types that represent units of measurement.

Required methods

fn pack(_: f64) -> Self

Create a new instance of self by wrapping a value

fn unpack(self) -> f64

Unpack a wrapped value without any error checking.

fn unwrap(self) -> f64

Unwrap the value from the new type and check for validity, panic if contents are invalid.

fn into_option(self) -> Option<f64>

Convert into an option that is None if the content is invalid.

Loading content...

Provided methods

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity

Test whether these two values are close

fn abs(self) -> Self

Test whether these two values are close

Loading content...

Implementations on Foreign Types

impl Quantity for f64
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for u8
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

Loading content...

Implementors

impl Quantity for Celsius
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for CelsiusDiff
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for CelsiusPKm
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Cm
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Decameters
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Fahrenheit
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for FahrenheitDiff
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for FahrenheitPKft
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Feet
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for HectoPascal
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for HydrolapseGPKgPKm
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for HydrolapsePKm
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Inches
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for JpKg
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for JpKgpK
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Kelvin
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Km
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for KmPHour
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Knots
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Meters
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for MetersPSec
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for MicroBarPS
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for MilesPHour
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Millibar
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for Mm
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

impl Quantity for PaPS
[src]

fn approx_eq<RHS, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + From<TOL> + Quantity
[src]

fn abs(self) -> Self
[src]

Loading content...