Skip to main content

Crate enum_variant_name_const

Crate enum_variant_name_const 

Source
Expand description

#[derive(EnumVariantNameConst)]

Adds

pub const fn variant_name(&self) -> &'static str

to the enum, returning the precise identifier of the variant (“A”, “B”, …) and usable in const contexts.

Derive Macros§

EnumVariantNameConst
Derive macro that injects a