pub trait Tokenizer:
'static
+ Clone
+ Send
+ Sync {
type TokenStream<'a>: TokenStream;
// Required method
fn token_stream<'a>(&'a mut self, text: &'a str) -> Self::TokenStream<'a>;
}Expand description
Tokenizer splits text into a token stream.
Required Associated Types§
Sourcetype TokenStream<'a>: TokenStream
type TokenStream<'a>: TokenStream
Stream type emitted by the tokenizer.
Required Methods§
Sourcefn token_stream<'a>(&'a mut self, text: &'a str) -> Self::TokenStream<'a>
fn token_stream<'a>(&'a mut self, text: &'a str) -> Self::TokenStream<'a>
Create a token stream for the provided text.
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.