This Rust library provides compiler-checked types for the standard set of SI units, as specified by the US National Institute of Standards and Technology (this project is not officially endorsed by NIST).
f32
or f64
or other number-like type as your concrete number type.The version of this library will be incremented to reflect progress through the various milestones. The goal is to reach version 1.0 (API stable) as quickly as practical.
Into
and From
conversion to/from uom typesFor each type of unit (eg Length), Simple SI Units provides a struct to
represent the unit and which implements common type conversion. For
example, dividing a Length by a Time results in a Velocity:
rust
todo!();
Simple SI Units does not provide an exhaustive list of possible units of
measure. To create your own units, use the Unit
procedural macro and
UnitData
trait bundle, like this:
```rust use simplesiunits::{Unit, UnitData};
struct HyperVelocity
fn weighted_sum
This library is open source, licensed under the Mozilla Public License version 2.0. In summary, you may include this source code as-is in both open-source and proprietary projects without requesting permission from me, but if you modify the source code from this library then you must make your modified version of this library available under an open-source license.