auto-variants 0.1.0

A macro that exposes a function that returns all enum variants.
Documentation
1
2
3
4
5
6
7
8
9
pub use autovariants_derive::Variants;
pub trait Variants<const N: usize>
where
    Self: Sized,
{
    const VARIANTS: [Self; N];
    /// Returns a static reference to all variants of this enum
    fn variants() -> &'static [Self];
}