pub trait SourceToken: Copy {
type Kind: Copy;
const EMPTY: Self;
// Required methods
fn kind(self) -> Self::Kind;
fn len(self) -> u32;
fn kind_name(self) -> &'static str;
// Provided methods
fn leading_len(self) -> u32 { ... }
fn trailing_len(self) -> u32 { ... }
fn is_empty(self) -> bool { ... }
}Expand description
A token that occupies bytes in source text.
Required Associated Constants§
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn leading_len(self) -> u32
fn leading_len(self) -> u32
Returns bytes before token value.
Sourcefn trailing_len(self) -> u32
fn trailing_len(self) -> u32
Returns bytes after token value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".