Trait enum_traits::FromIndex [] [src]

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

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

Required Methods

Tries to construct Self from an index based on the variants' defined order

Constructs Self from an index based on the variants' defined order

Implementors