Macro enum_str::enum_str
[−]
[src]
macro_rules! enum_str { ($name:ident, $(($key:ident, $value:expr),)*) => { ... }; }
Macro used to generate an enum with FromStr
and AsStr
trait implementations.
The enum is identified by the name
passed to the macro. Enum values are identified by
the key
passed in each tuple. The 'value' is used as the string representation for
FromStr and AsStr traits.
See crate Example for usage.