from-repr-enum-derive
A crate to derive from for an Enum with a repr defined
Currently a #[repr()]
is needed for the derive to work
Example:
extern crate from_repr_enum_derive;
The match block that is created needs a default enum variant. The crate has a default of Unknown
Custom default variant
You can define your own with another attribute #[ReprEnumDefault = ""]
Notes
The match block generated tries to use the Enum name with a wildcard. If the variants aren't found by the compiler you might need to add use path::to::Enum::*