Trait VariantEnum

Source
pub trait VariantEnum {
    type Variant: Copy + Eq + Hash;

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

A trait that must be implemented by enums that are used with VariantSet.

This trait provides a way to get the variant of an enum, which is another enum that represents the variants of the original enum, but without the data.

Required Associated Types§

Source

type Variant: Copy + Eq + Hash

The enum that represents the variants of the original enum, but without the data.

Required Methods§

Source

fn variant(&self) -> Self::Variant

For a given value of the enum, returns the variant of the enum.

Implementors§