Skip to main content

EnumTag

Trait EnumTag 

Source
pub trait EnumTag {
    type Tag;

    // Required method
    fn tag(&self) -> Self::Tag;
}
Expand description

Trait implemented by enum types.

This trait usually is implemented via #[derive(EnumTag)].

Required Associated Types§

Source

type Tag

The type of the enum’s tag.

Required Methods§

Source

fn tag(&self) -> Self::Tag

Returns the tag of self where Self is a Rust enum type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§