define_bounds

Macro define_bounds 

Source
macro_rules! define_bounds {
    ($((
        // The name of the boundary type.
        $name:ident,
        // The underlying primitive type. This is usually, but not always,
        // the smallest signed primitive integer type that can represent both
        // the minimum and maximum boundary values.
        $ty:ident,
        // A short human readable description that appears in error messages
        // when the boundaries of this type are violated.
        $what:expr,
        // The minimum value.
        $min:expr,
        // The maximum value.
        $max:expr $(,)?
    )),* $(,)?) => { ... };
}
Expand description

This macro writes out the boiler plate to define a boundary type.

Specifically, it implements the Bounds trait and provides a few concrete methods. The concrete methods are mostly wrappers around the generic trait methods. They are provided so that callers don’t have to import the Bounds trait to use them.