Module dimensioned::dimensioned [] [src]

This module allows dimensioned to be very flexible. It creates the Dim<D, V> type, which is the type that will be used for all dimensioned objects. It then implements as many traits from std as generically as possible.

Among the included traits in dimensioned, there are a few that are used solely to aid in generic programming and should not be implemented for anything outside this module. They are Dimension, Dimensionless, and DimToString.

Structs

Dim

This is the primary struct that users of this library will interact with.

Traits

Cbrt

Cbrt is used for implementing a cbrt() member for types that don't impl Float.

DimToString

This trait allows human-friendly printing of dimensioned objects. It is used to implement the traits in std::fmt.

Dimension

All types created for a unit system will implement this trait. No other types should implement it. The struct Dim<D, V> requires that D implement Dimension.

Dimensionless

The only types that implement this trait are the Unitless types that exist in each unit system. It allows more flexibility when handling specifically objects without dimension.

Pow

Pow is used for implementing general integer powers for types that don't impl Float and whose type signature changes when multiplying, such as Dim<D, V>.

Recip

Recip is used for implementing a recip() member for types that don't impl Float.

Root

Root is used for implementing general integer roots for types that don't impl Float and whose type signature changes when taking a root, such as Dim<D, V>.

Sqrt

Sqrt is used for implementing a sqrt() member for types that don't impl Float.