#enums #macro #dealing #convert #variant #usize #macro-derive

macro derive_custom_enum_traits

Derive macros for dealing with enums. This adds derive macros to the custom_enum_traits package.

1 unstable release

0.1.0 Mar 3, 2022

#27 in #usize

MIT license

5KB

derive_custom_enum_traits

This is a set of (currently one) derive macros for Rust for dealing with enums. Its current macro, DeriveIndex creates two functions for an enum, to_index, which converts an enum variant into its 0-indexed order; and from_index which converts a usize into an Option<Variant>.


lib.rs:

derive_custom_enum_traits serves as a collection of (currently one) derivable macros for dealing with enums.

Dependencies

~1.5MB
~37K SLoC