Trait enum_traits::FromIndex [] [src]

pub trait FromIndex: Index + Sized {
    fn from_index(index: Self::Type) -> Option<Self>;
}

Derive this trait for an enum using #[derive(EnumFromIndex)]

Required Methods

fn from_index(index: Self::Type) -> Option<Self>

Tries to construct an enum from a index in the enum's variants' defined order

Implementors