Module unit

Module unit 

Source
Expand description

This module contains the Unit struct and supporting code. See the documentation string of Unit for more information.

Structs§

Unit
Struct representing a unit of measurement in the SI system via the exponents of the base units. The unit is purely defined by the values of its fields, meaning that it can change at runtime. The struct implements basic arithmetic functions such as multiplication and division (via the Mul, MulAssign, Div, DivAssign traits), exponentiation (Unit::powi) and a fallible version of root calculation (Unit::try_nthroot).

Enums§

PredefUnit
An enum representing predefined Units.

Traits§

UnitFromType
A trait to derive Unit from a type. This trait bridges the gap between (external) types representing physical quantities (such as e.g. the Quantity type from the uom crate) and Unit.