A small crate that provides simple derive macros for enumerations.
#[derive(OrdinalEnum)]
pub enum AnimalType {
Cow, // ordinal: 0
Cat, // ordinal: 1
Sheep // ordinal: 2
}
Adds ordinal() and from_ordinal() methods
#[derive(NamedEnum)]
pub enum AnimalType {
Cow, // "Cow"
Cat, // "Cat"
Sheep // "Sheep"
}
Adds name() and from_name() methods