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
fn from_index(index: Self::Type) -> Option<Self>
Tries to construct Self
from an index based on the variants' defined order
unsafe fn from_index_unchecked(index: Self::Type) -> Self
Constructs Self
from an index based on the variants' defined order