Mag is a library for dealing with units of measure. Magnitude!
Highlights
- Easy to understand and use
- No external dependencies
- Fast compile time
- Units are not discarded when creating quantities. In keeping with Rust
philosohpy, conversions must be done manually (using the
to
method).
Example
```rust
use mag::length::{ft, m};
let a = 1.0 * ft; // Length
let b = a.to::(); // Length
asserteq!(b.tostring(), "0.3048 m");
```
Room For Improvement
- Small set of quantities and units implemented
- Quantities are f64 only
Alternatives
There are similar crates out there. Here is a partial list:
- [uom]
- [dimensioned]
- [yaiouom]
- [measurements]
- [simple_units]
- [metric]
- [unit]
- Plus many more!