pub trait Tokenize: Sized {
type CharType;
// Required method
fn next_token<I>(input: &mut I) -> Result<Token<Self>>
where I: InputStream<CharType = Self::CharType>;
// Provided method
fn lexer<I>(input: I) -> Lexer<I, Self> { ... }
}Expand description
Trait for token kinds that can be tokenized from an input stream.
Required Associated Types§
Required Methods§
Sourcefn next_token<I>(input: &mut I) -> Result<Token<Self>>where
I: InputStream<CharType = Self::CharType>,
fn next_token<I>(input: &mut I) -> Result<Token<Self>>where
I: InputStream<CharType = Self::CharType>,
Reads the next token from the given input stream.
Returns the token (Token<Self>) if successful, otherwise Err.
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.