Skip to main content

nonneg

Macro nonneg 

Source
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 a NonNegative from value.
  • nonneg!(Type) creates a default zero value of that type.
  • nonneg!(Type, value) creates a NonNegative of the specified type.