pub trait LinearScaledUnit: Unit {
    const REF_UNIT: Self;

    fn scale(&self) -> AmountT;

    fn from_scale(amnt: AmountT) -> Option<Self> { ... }
    fn is_ref_unit(&self) -> bool { ... }
    fn ratio(&self, other: &Self) -> AmountT { ... }
}
Expand description

Type of units being linear scaled in terms of a reference unit.

Required Associated Constants

Unit used as reference for scaling the units.

Required Methods

Returns factor so that factor * Self::REFUNIT == 1 * self.

Provided Methods

Returns Some(unit) where unit.scale() == Some(amnt), or None if there is no such unit.

Returns true if self is the reference unit of its unit type.

Returns factor so that factor * other == 1 * self.

Implementors