Expand description

Latest Release pipeline status coverage report


Yet one more another unit/dimension support library for rust.

This package lets you write units of physical quantities in the same way you always write it.


use ::unitage:: { *, predefined::* };

fn bmi(hight: Length<f64>, weight: Mass<f64>) -> f64 {
    let bmi = weight / hight / hight;


let h = pq!(5f64, "ft.") + pq!(8f64, "in.");
let w = pq!(200f64, "lb");

assert_eq!(bmi(h, w), 30.409583894427303); // Lose weight!!

Package Structure

This package is a entry points for each implementation packages.

For details following topics, please refer the documentation of each sub-package.


pub use const_frac;
pub use typenum;
pub use unit_proc;
pub use real_proc;



Generate Dim from unit string.

Generate Frac from decimal numerical literal. When the argument is illegal, compile will fail.

Generate PhysicalQuantity from value and unit string.

Generate Unit from unit string.


linear convertion coefficients target_unit = a * source_unit_value + b

Static (compile time) Dimension.

Dynamic (runtime) Dimension

Representation of fractional value.

Represents physical quantity

Representation of Unit


Requirements for a type which represents real value.