macro_rules! nonneg {
($t:ty) => { ... };
($val:expr) => { ... };
($t:ty, $val:expr) => { ... };
}Expand description
Macro to create a NonNegative value.
Returns Result<NonNegative<T>, NonNegativeError>.
Usage:
nonneg!(value)infers type and creates aNonNegativefromvalue.nonneg!(Type)creates a default zero value of that type.nonneg!(Type, value)creates aNonNegativeof the specified type.