enum-tags
A Derive-Macro library that generates a companion tag-enum for any enum so that variants can be referred to without specifying fields.
Usage
Add this to your Cargo.toml:
[dependencies]
enum-tags = "0.1.0"
Then derive [Tag
] for any enum you want to generate a companion tag-enum for.
The generated enum will look like this:
An impl
for the [TaggedEnum
] trait will also be generated to allow conversion from your enum type to the tag-enum.
The generated impl
will look like this: