Macro uom::ISQ [−][src]
macro_rules! ISQ { ($path:path) => { ... }; ($path:path, $V:ty) => { ... }; ($path:path, $V:ty, $U:tt) => { ... }; }
Macro to implement quantity
type aliases for a specific
system of units and value storage type.
$path
: Path to the module where thesystem!
macro was run (e.g.::uom::si
).$V
: Underlying value storage type (e.g.f32
).$U
: Optional. Base units. Pass as a tuple with the desired units:(meter, kilogram, second, ampere, kelvin, mole, candela)
. The system's base units will be used if no value is provided.
An example invocation is given below for a meter-kilogram-second system setup in the
module mks
with a system of quantities name Q
. The #[macro_use]
attribute must be
used when including the uom
crate to make macros for predefined systems available.
The optional units parameter to change the base units is included commented out.
#[macro_use] extern crate uom; mod f32 { Q!(mks, f32/*, (centimeter, gram, second)*/); }