pub trait Token: Display {
// Required methods
fn variant_name(&self) -> &'static str;
fn parser_token(&self) -> &'static str;
fn kinds(&self) -> &'static [&'static str];
fn all_tokens() -> &'static [TokenDescriptor];
}
Expand description
Trait to implement for a token to be used with lang_util
’s infrastructure
Required Methods§
Sourcefn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
Return the variant name of the current token
Sourcefn parser_token(&self) -> &'static str
fn parser_token(&self) -> &'static str
Return the name used by the lalrpop parser for this token
Sourcefn all_tokens() -> &'static [TokenDescriptor]
fn all_tokens() -> &'static [TokenDescriptor]
Return the descriptions for all known tokens
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.