unit-proc

Crates.iounit-proc
lib.rsunit-proc
version0.0.3
sourcesrc
created_at2022-03-02 13:33:10.544426
updated_at2022-03-17 15:37:54.646429
descriptionProcedual macros for physical quantities.
homepagehttps://gitlab.com/fton/unit-proc
repositoryhttps://gitlab.com/fton/unit-proc
max_upload_size
id542273
size22,092
(fton)

documentation

README

Latest Release pipeline status coverage report

Description

Procedural macro for generate struct Unit in compile time.

This package is the implementation of the procedural macro. For use these macros in your code, unitage is convenient.

Usage

extern crate typenum;

use unit_proc::unit;
use const_frac::Frac;
use physical_quantity:: { Unit, Dim };
use typenum;

let height = unit!("ft.").pq(5f64) + unit!("in.").pq(8f64);
let cm = unit!("cm").value(height);

assert_eq!(cm, 172.72);

Project status

This package is in the very early stage.

Commit count: 19

cargo fmt