pub trait Times<T: Nat>: Nat {
type Result: Nat;
}
Expand description
§Multiplication
It’s time to get timesing at compile-time! That sounded way cooler in my head.
assert_eq!(<Four as Times<Three>>::Result::eval(), 12);
assert_eq!(<Seven as Times<One>>::Result::eval(), 7);
assert_eq!(<Three as Times<Three>>::Result::eval(), 9);
assert_eq!(<Two as Times<Three>>::Result::eval(), 6);
assert_eq!(<Six as Times<Seven>>::Result::eval(), 42);