Derive Macro num_variants::NumVariants

source ·
#[derive(NumVariants)]
{
    // Attributes available to this derive:
    #[num_variants]
}
Expand description

Derives an associated constant with the number of variants this enum has.

The default constant name is NUM_VARIANTS. This can be customized with #[num_variants = "FOO")].