Crate enum_macros

source ·
Expand description

A collection of useful macros that make working with enums easier.

Attribute Macros§

  • Adds support for custom enum “discriminants” of other types than isize.
  • Adds a new enum that has the same variants as this enum, but holds no data. The new enum will be called {OLD_NAME}Marker and always implement Clone and Copy.
  • Adds a method for advancing to the next enum variant. Wraps around at the last element.
  • Adds a constant storing the amount of variants the enum has to the enum.