pub struct Mass { /* private fields */ }
Expand description

The quantity of matter in a physical body.

Also used as measure of a physical body’s resistance to acceleration.

Reference unit: Kilogram (‘kg’)

Predefined units:

SymbolNameDefinitionEquivalent in ‘kg’
mgMilligram0.001·g0.000001
ctCarat0.2·g0.0002
gGram0.001·kg0.001
ozOunce0.0625·lb0.028349523125
lbPound0.45359237·kg0.45359237
stStone14·lb6.35029318
tTonne1000·kg1000

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Unit used as reference for scaling the units of Self::UnitType.

Returns Some(unit) where unit.scale() == amnt, or None if there is no such unit. Read more

Returns factor so that factor * unit == self.

Returns qty where qty == self and qty.unit() is to_unit.

Returns true, if self and other have equivalent amounts, otherwise false. Read more

Returns the partial order of selfs amount and others eqivalent amount in selfs unit. Read more

Returns the sum of self and other

Returns the difference between self and other

Returns the quotient self / other

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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

Associated type of unit

Returns a new instance of the type implementing Quantity.

Returns the amount of self.

Returns the unit of self.

Returns an iterator over the variants of Self::UnitType.

Returns Some(unit) where unit.symbol() == symbol, or None if there is no such unit. Read more

Return true if self and other have the same unit and their amounts are equal, otherwise false. Read more

Returns the partial order of selfs and others amounts, if both have the same unit, otherwise None. Read more

Returns the sum of self and other, if both have the same unit. Read more

Returns the difference between self and other, if both have the same unit. Read more

Returns the quotient self / other, if both have the same unit. Read more

Formats self using the given formatter. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.