Struct measurements::Weight [] [src]

pub struct Weight { /* fields omitted */ }

The Weight struct can be used to deal with weights in a common way.

Example

use measurements::Weight;

let metric_ton = Weight::from_metric_tons(1.0);
let united_states_tons = metric_ton.as_short_tons();
let united_states_pounds = metric_ton.as_pounds();
println!("One metric ton is {} U.S. tons - that's {} pounds!", united_states_tons, united_states_pounds);

Methods

impl Weight
[src]

Trait Implementations

impl Copy for Weight
[src]

impl Clone for Weight
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Weight
[src]

Formats the value using the given formatter.

impl Measurement for Weight
[src]

impl Add for Weight
[src]

The resulting type after applying the + operator

The method for the + operator

impl Sub for Weight
[src]

The resulting type after applying the - operator

The method for the - operator

impl Div<Weight> for Weight
[src]

The resulting type after applying the / operator

The method for the / operator

impl Div<f64> for Weight
[src]

The resulting type after applying the / operator

The method for the / operator

impl Mul<Weight> for Weight
[src]

The resulting type after applying the * operator

The method for the * operator

impl Mul<f64> for Weight
[src]

The resulting type after applying the * operator

The method for the * operator

impl Eq for Weight
[src]

impl PartialEq for Weight
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd for Weight
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Display for Weight
[src]

Formats the value using the given formatter. Read more