Skip to main content

Variants

Trait Variants 

Source
pub trait Variants: Copy + 'static {
    const TYPE: &'static str;
    const VARIANTS: &'static [(&'static str, Self)];
    const PATH: &'static str = Self::TYPE;
    const TRANSITIONS: &'static [(Self, Self)] = _;

    // Provided methods
    fn name(self) -> &'static str { ... }
    fn to(self, next: Self, field: &str) -> Result<Self> { ... }
}

Required Associated Constants§

Source

const TYPE: &'static str

Source

const VARIANTS: &'static [(&'static str, Self)]

Provided Associated Constants§

Source

const PATH: &'static str = Self::TYPE

Module-qualified, so two enums of one name keep their recorded moves apart.

Source

const TRANSITIONS: &'static [(Self, Self)] = _

Provided Methods§

Source

fn name(self) -> &'static str

Source

fn to(self, next: Self, field: &str) -> Result<Self>

A refused move is an error on field, the one holding the value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§