Trait dimensioned::traits::Dimensioned
[−]
[src]
pub trait Dimensioned { type Value; type Units; fn new(val: Self::Value) -> Self; fn value_unsafe(&self) -> &Self::Value; }
Allows one to refer to quantities generically.
It is not recommened to implement this for anything outside this this crate.
Associated Types
type Value
The type of the value of a quantity. E.g. For si::Meter<f64>
, Value
is f64
.
type Units
The units of a quanitity. This will be a type-array of type-numbers. E.g. For
si::Meter<f64>
, Units
is tarr![P1, Z0, Z0, Z0, Z0, Z0, Z0]
.
Required Methods
fn new(val: Self::Value) -> Self
Construct a new quantity.
fn value_unsafe(&self) -> &Self::Value
Extract the value from a quantity. As this ignores the units completely, it is dimensionally unsafe.