Crate simple_units

Source
Expand description

simple_units: a simple unit system for Rust

Written by Willi Kappler, Version 0.1 (2017.02.22)

Repository: https://github.com/willi-kappler/simple_units

License: MIT

Modules§

conversion
Conversion between units
si_units
Data types and utility function for units: Implement a poor man’s unit type system for now…

Macros§

combine_unit
This macro combines two units and some permutation / inverse
convert_unit
This macro implements From for the given units. It either uses a factor or a closure to calculate the conversion
init_unit
This macro initializes a new unit
init_unit_and_inverse
This macro implements a new unit and the inverse unit
inverse_unit
This macro implements the inverse of the given unit
mul_div_unit
This macro implements multiplication and division for a given unit
power3_unit
This macro implements unit^1, unit^2, unit^3, 1/unit^1, 1/unit^2 and 1/unit^3