Crate enum_traits

Source
Expand description

Simple traits for builtin enum items. Primarily used by enum_traits_macros when automatically deriving types. The crate enum_traits_macros is required for the derives.

Traitsยง

Discriminant
Derive this trait for an enum automatically using #[derive(EnumDiscriminant)] This trait can only be derived when every item have an explicitly defined discriminant.
Ends
Derive this trait for an enum automatically using #[derive(EnumEnds)]
FromIndex
Derive this trait for an enum automatically using #[derive(EnumFromIndex)]
Index
Represents the type used for indexing the variants of the enum item. Type should be an primitive integer type and have more values or an equal number of values compared to the number of variants in the enum item.
Iterable
Derive this trait for an enum automatically using #[derive(EnumIter)]
Len
Derive this trait for an enum automatically using #[derive(EnumLen)]
ToIndex
Derive this trait for an enum automatically using #[derive(EnumToIndex)]