Newtype Variant Conversions
Rust macro crate to automatically generate conversions from variant types into the target enum.
This crate requires Rust 1.15 or above to compile on stable.
extern crate from_variants;
Features
- Variant opt-out: To skip a variant, add
#[from_variants(skip)]
to a specific variant. - no_std support: To generate conversions using
core::convert::From
, add#[from_variants(no_std)]
at the struct level.