pub trait Token: Clone + Debug {
type TokenID: Into<usize>;
// Required methods
fn token_id(&self) -> Self::TokenID;
fn line_no(&self) -> usize;
}Expand description
A trait representing a token in lexical analysis or parsing.
Defines the minimal interface for objects treated as tokens, providing a token identifier and its line position in the source.
Required Associated Types§
Required Methods§
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.