Crate new_units

Crate new_units 

Source
Expand description

Zero-hassle marker unit library. Correct code made easy.

§Example

use new_units::*;

struct Inches;
assert_eq!(
    3.of(Inches) * 10.of(Inches),
    30.of(Inches) * 1,
    "The answer isn't `30 Inches²` because this crate is not for units of measure.",
);
assert_eq!(3.of(Inches), 3);

Structs§

Unit
Add a marker to another type, eg Unit<Point3, LastPosition>.

Traits§

OfUnit
Utility trait for constructing Units.

Type Aliases§

IndexTo
IndexTo<Cars> indexes Vec<_, Cars>.