Trait VariantDescriptors

Source
pub trait VariantDescriptors {
    // Required methods
    fn variant_names_with_token_counts(    ) -> &'static (&'static [&'static str], &'static [usize], usize, usize);
    fn variant_name_with_token_count(&self) -> (&'static str, 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() -> &'static (&'static [&'static str], &'static [usize], usize, 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) -> (&'static str, 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.

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§