pub trait VariantDescriptors {
    // Required methods
    fn variant_names_with_token_counts() -> Vec<(String, usize)>;
    fn variant_name_with_token_count(&self) -> (String, usize);
}
Expand description

A trait to provide descriptors for the variants of an enumeration. This includes the names of the variants and the count of tokens in their names.

Required Methods§

source

fn variant_names_with_token_counts() -> Vec<(String, usize)>

Returns the names of the variants of the enum and the count of tokens in each variant’s name.

§Returns

A Vec of tuples where each tuple’s first element is a String representing the name of a variant, and the second element is a usize representing the count of tokens in the variant’s name.

source

fn variant_name_with_token_count(&self) -> (String, usize)

Returns the name of a variant and the count of tokens in its name.

§Returns

A tuple where the first element is a String representing the name of the variant, and the second element is a usize representing the count of tokens in the variant’s name.

Object Safety§

This trait is not object safe.

Implementors§