[][src]Module fts_units::si_system

Structs and traits to enable SI Unit quantities.

There are three core structs with matching traits.

pub struct SIUnitsT<RATIOS,EXPONENTS> { ... }
pub struct SIRatiosT<LENGTH, MASS, TIME> { ... }
pub struct SIExponentsT<LENGTH, MASS, TIME> { ... }

pub trait SIUnits { type Ratios: SIRatios; type Exponents: SIExponents; }
pub trait SIRatios { type Length; type Mass; type Time; }
pub trait SIExponents { type Length; type Mass; type Time; }

SIUnitsT has RATIOS and EXPONENTS. Traits such as std::ops::Add are implemented for SIUnitsT<R,E> when R and E are the same. std::ops::mul is implemented for any pair of exponents, but with an Xor restriction on R.

Re-exports

pub use self::ratios::*;

Modules

exponents

Convenient SIExponentsT types — Length, Mass, etc.

quantities

Convenient QuantityT types — Length<T,R>, Velocity<T,RL,RT>, etc.

ratios

Convenient RatioT types — Mega, Kilo, Centi, Nano, etc.

units

Convenient SIUnitsT types — Length<R>, Mass<R>, etc.

Structs

SIExponentsT

Holds type exponents for each si_system dimension.

SIRatiosT

Holds type Ratios for each si_system dimension.

SIUnitsT

Foundational type of si_system. Holds all Ratios and Exponents as types.

Traits

SIExponents

Helper to faciliate generic operations on SIExponentsT<L,M,T>.

SIRatios

Helper to faciliate generic operations on SIRatiosT<L,M,T>.

SIUnits

Helper to faciliate generic operations on SIUnitsT<R,E>.