Enum const value
A derive macro that will add const values for enum cases, even enums with associated types. When dealing with an enum with associated types, the macro creates a new enum with the const values.
Usage
[]
= "0.1.0"
Now in your project, add the following:
use EnumConstValue;
and use the derive macro on an enum
Now, you can use use the const_value()
method on an enum case like so:
TODO
- Custom enum case values (can be done by adding attributes)
- Custom derived enum name (is currently always $ENUMNAME$ConstValue)