pub trait Token: Debug {
Show 13 methods
// Required methods
fn token_id(&self) -> TokenId;
fn token_type(&self) -> i32;
fn channel(&self) -> i32;
fn start(&self) -> usize;
fn stop(&self) -> usize;
fn line(&self) -> usize;
fn column(&self) -> usize;
fn text(&self) -> Option<&str>;
fn source_name(&self) -> &str;
fn start_byte(&self) -> usize;
fn stop_byte(&self) -> usize;
// Provided methods
fn interval(&self) -> TextInterval { ... }
fn byte_span(&self) -> Range<usize> { ... }
}Required Methods§
fn token_id(&self) -> TokenId
fn token_type(&self) -> i32
fn channel(&self) -> i32
Sourcefn stop(&self) -> usize
fn stop(&self) -> usize
Zero-based absolute inclusive stop index measured in Unicode scalar values.
Sourcefn column(&self) -> usize
fn column(&self) -> usize
Zero-based source column where the token starts, measured in Unicode
scalar values from the start of line.
fn text(&self) -> Option<&str>
fn source_name(&self) -> &str
Sourcefn start_byte(&self) -> usize
fn start_byte(&self) -> usize
Zero-based absolute start offset measured in UTF-8 bytes.
Provided Methods§
fn interval(&self) -> TextInterval
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".