pub trait Logos<'source>: Sized {
type Extras;
type Source: Source + ?Sized + 'source;
const ERROR: Self;
// Required method
fn lex(lexer: &mut Lexer<'source, Self>);
// Provided methods
fn lexer(source: &'source Self::Source) -> Lexer<'source, Self> ⓘ
where Self::Extras: Default { ... }
fn lexer_with_extras(
source: &'source Self::Source,
extras: Self::Extras,
) -> Lexer<'source, Self> ⓘ { ... }
}Expand description
Trait implemented for an enum representing all tokens. You should never have
to implement it manually, use the #[derive(Logos)] attribute on your enum.
Required Associated Constants§
Required Associated Types§
Required Methods§
Provided 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.