pub trait ParserTrait<'input> {
// Required methods
fn peek(&mut self) -> Option<Result<&(Event<'input>, Span), ScanError>>;
fn next_event(&mut self) -> Option<Result<(Event<'input>, Span), ScanError>>;
fn load<R: SpannedEventReceiver<'input>>(
&mut self,
recv: &mut R,
multi: bool,
) -> Result<(), ScanError>;
}Expand description
Trait extracted from Parser to support mocking and alternative implementations.
Required Methods§
Sourcefn peek(&mut self) -> Option<Result<&(Event<'input>, Span), ScanError>>
fn peek(&mut self) -> Option<Result<&(Event<'input>, Span), ScanError>>
Try to load the next event and return it, but do not consuming it from self.
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.