Macro enum_ordinalize::create_ordinalized_enum [−][src]
macro_rules! create_ordinalized_enum { ( $name:ident, $t:ty $( ,$variants:ident )+ $(,)* ) => { ... }; ( $name:ident, $t:ty $( ,$variants:ident = $values:expr )+ $(,)* ) => { ... }; ( pub $name:ident, $t:ty $( ,$variants:ident )+ $(,)* ) => { ... }; ( pub $name:ident, $t:ty $( ,$variants:ident = $values:expr )+ $(,)* ) => { ... }; }
Create an enum and implement a ordinal
method and a from_ordinal
associated function for it. The new enum also implements Debug
, PartialEq
, and Clone
traits.