Macro numeric_enum

Source
macro_rules! numeric_enum {
    (#[repr($repr:ident)]
     $(#$attrs:tt)* $vis:vis enum $name:ident {
        $($(#$enum_attrs:tt)* $enum:ident = $constant:expr),* $(,)?
    } ) => { ... };
}
Expand description

Declares an enum with a given numeric representation defined by literals.

Only explicitly enumerated enum constants are supported.

Automatically derives TryFrom<$repr> and From<$name>.

For examples look at the crate root documentation.