TokenRole

Trait TokenRole 

Source
pub trait TokenRole:
    Copy
    + Eq
    + Send {
    // Required methods
    fn universal(&self) -> UniversalTokenRole;
    fn name(&self) -> &str;
}
Expand description

A trait for types that can represent a token’s syntactic role.

Required Methods§

Source

fn universal(&self) -> UniversalTokenRole

Maps this role to a universal, language-agnostic role.

Source

fn name(&self) -> &str

Returns a specific name for this role, used for granular highlighting.

For universal roles, this should return the standard scope name (e.g., “keyword”). For language-specific roles, it can return more specific names (e.g., “keyword.control”).

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§