Skip to main content

Unitless

Type Alias Unitless 

Source
pub type Unitless<V> = CGS<V, Unitless>;

Aliased Type§

pub struct Unitless<V> {
    pub value_unsafe: V,
    /* private fields */
}

Fields§

§value_unsafe: V

This is the value of whatever type we’re giving units. Using it directly bypasses all of the dimensional analysis that having a unit system provides, and should be avoided whenever possible.

If using this member is necessary, it is strongly encouraged to wrap the calculation in a dimensionally-safe interface.

Trait Implementations§

Source§

impl<Value> Dimensionless for Unitless<Value>

Source§

fn value(&self) -> &Value

Extract the value from a quantity with no units. As there are no units to ignore, it is dimensionally safe.
Source§

impl<ValueIn, ValueOut> Map<ValueOut> for Unitless<ValueIn>

Source§

type Output = CGS<ValueOut, TArr<Z0, TArr<Z0, TArr<Z0, ATerm>>>>

The type to which the input is mapped
Source§

fn map<F: FnOnce(ValueIn) -> ValueOut>(self, f: F) -> Self::Output

Perform the map