pub trait LazyParser<'a> {
type Output;
type Error;
// Required methods
fn parse_lazy(
&mut self,
input: &'a [u8],
) -> Result<Self::Output, Self::Error>;
fn remaining(&self) -> &'a [u8] ⓘ;
fn is_complete(&self) -> bool;
fn reset(&mut self);
}
Expand description
Zero-copy lazy parser trait with lifetime management
This trait enables parsers that work directly on input buffers without copying data, using Rust’s lifetime system to ensure memory safety.
Required Associated Types§
Required Methods§
Sourcefn parse_lazy(&mut self, input: &'a [u8]) -> Result<Self::Output, Self::Error>
fn parse_lazy(&mut self, input: &'a [u8]) -> Result<Self::Output, Self::Error>
Parse input lazily, returning references into the original buffer
Sourcefn is_complete(&self) -> bool
fn is_complete(&self) -> bool
Check if parsing is complete