Skip to main content

Crate enum_helper

Crate enum_helper 

Source
Expand description

CI Latest Version Rust Documentation Crates.io Crates.io

Yet another enum helper.

This crate provides derive macros that generate common boilerplate for enums.

  • EnumStr: convert between enum and string
  • EnumAll: get an array of all variants
  • EnumKind: generate a unit kind enum from a data-carrying enum

§Feature flags

  • derive (default): re-exports derive macros
  • serde: provides serde helpers for use with EnumStr

Traits§

EnumAll
Get an array of all variants of an enum.
EnumKind
Get the kind of an enum variant.
EnumStr
Convert between enum and string.

Derive Macros§

EnumAll
Derive the EnumAll trait and generate an array of all variants.
EnumKind
Derive the EnumKind trait and generate a unit kind enum from a data-carrying enum.
EnumStr
Derive the EnumStr trait to convert between a unit enum and string.