Macro stacks_common::define_named_enum
source · macro_rules! define_named_enum { ($Name:ident { $($Variant:ident($VarName:literal),)* }) => { ... }; }
Expand description
Define a “named” enum, i.e., each variant corresponds to a string literal, with a 1-1 mapping. You get EnumType::lookup_by_name and EnumType.get_name() for free.