macro_rules! variant { ( $variant:ident @ $($enumeration:ident)::+ $(<$($generics:ty),+>)? ) => { ... }; }
Expand description
Checks for the presence of a variant on a enum
at compile-time and returns the field’s name as a &'static str
.
Invoked as variant!(Variant @ Enum)
, this macro verifies that a variant named Variant
exists on the type Enum
, and is visible at the point of invocation.
It then stringifies the variant name, evaluating to "Variant"
.
Refer to the crate-level documentation for more information.