Trait IndexedEnum
pub trait IndexedEnum:
Sized
+ Sealed
+ 'static {
const VARIANTS: &'static [Self];
// Required method
fn as_index(&self) -> usize;
}Expand description
Trait for enums that have fixed indexed variants.
Required Associated Constants§
const VARIANTS: &'static [Self]
const VARIANTS: &'static [Self]
A slice containing all the variants in index order.
The exact value is subject to change in any future release.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.