Trait enum_traits::Index [] [src]

pub trait Index {
    type Type;
}

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.

Derive this trait for an enum automatically using #[derive(EnumIndex)] When derived, Type becomes the type specified in the repr attribute for the enum item. If a repr attribute does not exist, a calculated minimum integer type based on the number of variant fields is used instead.

Associated Types

Type used as an index for the enum

Implementors