Skip to main content

EnumKind

Trait EnumKind 

Source
pub trait EnumKind: Copy {
    type Tag;

    // Required methods
    fn to_tag(self) -> Self::Tag;
    fn from_tag(tag: Self::Tag) -> Self;
}
Expand description

An Inline identifying variants of an Enum.

Required Associated Types§

Source

type Tag

Underlying Inline. Typically EnumTag.

Required Methods§

Source

fn to_tag(self) -> Self::Tag

Get the underlying Inline.

Source

fn from_tag(tag: Self::Tag) -> Self

Convert from an EnumTag assuming the value is within bounds, such that otherwise we have caught their violation during parsing of that tag.

Panics on out-of-bounds.

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.

Implementors§