enum-values 0.1.0

Exposes enum values via reflection
Documentation
#![doc = include_str!("../README.md")]

/// Captures basic data on an enum variant.
#[derive(Debug, Clone)]
pub struct VariantInfo {
    /// Name of the variant.
    pub name: &'static str,

    /// Value of the variant.
    pub value: u16,

    /// Documentation comment present on the variant.
    pub doc: &'static str,
}

/// Exposes variants of the enum.
pub trait EnumValues {
    /// Return the iterator over all variants of this enum.
    fn variants() -> impl Iterator<Item = VariantInfo>;
}

pub use enum_values_derive::EnumValues;