Enum Variant Macros
Macro library for use in generating From & TryFrom implementations for enums composed of unnamed single members. In other terms, of the following format.
This library has 2 macros, TryFromVariants & FromVariants.
TryFromVariants implements TryFrom for each of the variant types, permitting code such as,
use *;
use Error;
use IntoStaticStr;
Note: Derivation of this type also requires that impl From<Variant> for &'static str
is implemented.
FromVariants is relatively simple, it just generates From for each wrapped type.
use *;
let variant = from;
assert_eq!;
Note
If this library is not to your preference, may I recomend enum dispatch, a more expansive library that also provides from & try_into for enums.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.