[−][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 |
quantities | Convenient |
ratios | Convenient |
units | Convenient |
Structs
SIExponentsT | Holds type exponents for each |
SIRatiosT | Holds type Ratios for each |
SIUnitsT | Foundational type of |
Traits
SIExponents | Helper to faciliate generic operations on |
SIRatios | Helper to faciliate generic operations on |
SIUnits | Helper to faciliate generic operations on |