Crates.io | enumex |
lib.rs | enumex |
version | 0.1.0 |
source | src |
created_at | 2023-07-14 13:10:43.557463 |
updated_at | 2023-07-14 13:10:43.557463 |
description | Derive Macro for Plain Enum |
homepage | |
repository | https://github.com/dryBranch/enumex.git |
max_upload_size | |
id | 916023 |
size | 5,889 |
Provide Derive Macro for Plain Enum
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,
}