pub trait Choice: Copy {
const OPTIONS: &'static [&'static str];
// Required methods
fn to_index(self) -> usize;
fn from_index(i: usize) -> Self;
}Expand description
Conversion between enum variants and Inspector dropdown indices.
Required Associated Constants§
Required Methods§
Sourcefn to_index(self) -> usize
fn to_index(self) -> usize
Index of this variant in Self::OPTIONS.
Sourcefn from_index(i: usize) -> Self
fn from_index(i: usize) -> Self
Variant at an index; crate::choice_enum! clamps out-of-range indices to the last variant.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".