unitscale_macros
Overview
unitscale_macros provides procedural macros to simplify creating unit types and scale constants. This crate depends on unitscale_core and is intended to reduce boilerplate.
It exports two attribute macros:
#[unit_scale(to = float)]
: Declares a scale struct implementing UnitScale.#[unit_data]
: Generates a generic struct for the unit and implements TryFrom, Scaled, and new().
Example
use *;
use *;
;
;
let v = try_from.unwrap;
assert_eq!;