Unite
A small helper macro allowing you to compose existing types into an enum.
[]
= "0.1"
Usage
use unite;
;
;
;
unite!
This expands to:
Renaming
By default the enum variants use the same name as the type, but renaming is possible.
unite!
Helpers
The generated enums come with helper functions to access their variants with ease.
Variant names are automatically converted into snake_case
for the function names.
The generated enums also inherently implement From<Variant>
.
let any: Any = One.into;