Trait mag::quan::Unit

source · []
pub trait Unit {
    type Measure;

    const LABEL: &'static str;
    const FACTOR: f64;
    const ZERO: f64;
    fn convert<T>(val: f64) -> f64
    where
        T: Unit<Measure = Self::Measure>
, { ... } }
Expand description

Unit of measure

Associated Types

Measure (length, mass, etc.)

Associated Constants

Unit label

Factor to convert to base unit

Value of (absolute) zero

Provided methods

Convert a value to another unit of the same measure

Implementors