Skip to main content

EncodeLabelValue

Derive Macro EncodeLabelValue 

Source
#[derive(EncodeLabelValue)]
{
    // Attributes available to this derive:
    #[label]
}
Expand description

Derives EncodeLabelValue for an enum with only unit variants.

Each variant becomes a string label; default casing is snake_case. Use #[label(rename_all = "...")] on the enum or #[label(name = "...")] on a variant to customize. See EncodeLabelSet for the list of supported rename_all values. Derives EncodeLabelValue for an enum with only unit variants.

Maps each variant to its name (snake_case by default). Use #[label(rename_all = "...")] on the enum or #[label(name = "...")] per-variant to customize.