pub trait TextParserTrait {
// Required methods
fn position(&self) -> usize;
fn get(&mut self, offset: usize) -> Option<Result<char>>;
fn consume(&mut self, count: usize);
fn peeker(&mut self) -> impl PeekerTrait;
}Expand description
The trait for the text parser
Can be used to create a custom implementation of the TextParser struct
Required Methods§
Sourcefn get(&mut self, offset: usize) -> Option<Result<char>>
fn get(&mut self, offset: usize) -> Option<Result<char>>
Get the character at the given offset from the current position
Sourcefn peeker(&mut self) -> impl PeekerTrait
fn peeker(&mut self) -> impl PeekerTrait
Create a peeker that uses the current parser
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.