Trait yaiouom::Unit
[−]
[src]
pub trait Unit: Sealed { fn add_to_runtime(repr: &mut RuntimeUnit, positive: bool); fn new<T>(value: T) -> Measure<T, Self>
where
Self: Sized, { ... } fn as_runtime() -> RuntimeUnit { ... } }
A unit of measure.
To implement a new Unit, use BaseUnit.
Required Methods
fn add_to_runtime(repr: &mut RuntimeUnit, positive: bool)
Add a compile-type unit to a dynamic unit, either
in positive position (if positive
is true
)
or in negative position (if positive
is false
).
Used internally by as_runtime
, not particularly interesting otherwise.
Provided Methods
fn new<T>(value: T) -> Measure<T, Self> where
Self: Sized,
Self: Sized,
fn as_runtime() -> RuntimeUnit
Return a runtime representation of this unit. This method is designed for indexing and debugging. Not particularly fast.