pub trait EnumIndex {
    fn from_index(idx: usize) -> Option<Self>
    where
        Self: Sized
;
fn to_index(&self) -> usize; }
Expand description

Index items in an enum (and take an enum index and convert it to an enum variant)

Required methods

Convert an integer into an enum variant (where the first items are enumerated first, the second items second, etc.)

Take an enum variant and convert it into an index (where the first listed variant is enumerated first, the second second, etc.)

Implementors