[][src]Macro yaum::convert_div

macro_rules! convert_div {
    ($left:ty, $right: ty, $result: ty) => { ... };
}

Specify the result of division of two types.

Example

#[macro_use] extern crate yaum;
use yaum::*;
use yaum::time::*;

yaum::impl_unit!(BitSize, {
    b: 1.0,
    kb: 1024.0,
    Mb: 1024.0 * 1024.0
});

yaum::impl_unit!(BitSpeed, {
    bps: 1.0,
    kbps: 1024.0,
    Mbps: 1024.0 * 1024.0
});

// define relationship between units (BitSpeed = BitSize/Time)
yaum::convert_div!(BitSize, Time, BitSpeed);