Trait quantities::LinearScaledUnit
source · [−]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
Required Methods
Provided Methods
fn from_scale(amnt: AmountT) -> Option<Self>
fn from_scale(amnt: AmountT) -> Option<Self>
Returns Some(unit) where unit.scale() == Some(amnt), or None if
there is no such unit.
fn is_ref_unit(&self) -> bool
fn is_ref_unit(&self) -> bool
Returns true if self is the reference unit of its unit type.