1 unstable release
0.1.0 | Jul 14, 2023 |
---|
#27 in #plain
5KB
84 lines
Enum Extend
Provide Derive Macro for Plain Enum
Example
derive EnumStr
can impl Some Traits about str
and String
pub const as_str(&self) -> &'static str
AsRef<str>
ToString
From<&str>
From<&String>
From<String>
From<Str>
Maybe Panic!!!
use enumex::EnumStr;
#[derive(EnumStr)]
enum Animal {
Cat,
Dog,
}
Dependencies
~230–670KB
~16K SLoC