Skip to main content

Choice

Trait Choice 

Source
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§

Source

const OPTIONS: &'static [&'static str]

Ordered labels matching the enum’s declaration order.

Required Methods§

Source

fn to_index(self) -> usize

Index of this variant in Self::OPTIONS.

Source

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".

Implementors§

Source§

impl Choice for BodyKind

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for ClothPin

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for DecalBlend

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for DecalShape

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for Ease

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for EmitterShape

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for JointKind

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for LightKind

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for ModAxis

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for NoiseKind

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for ShapeKind

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for ShapeType

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for SwitchKind

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for TreeStyle

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for TweenMode

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for UiKind

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for Upscaler

Source§

const OPTIONS: &'static [&'static str]

Source§

impl Choice for WaterStyle

Source§

const OPTIONS: &'static [&'static str]