Trait LazyParser

Source
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§

Source

fn parse_lazy(&mut self, input: &'a [u8]) -> Result<Self::Output, Self::Error>

Parse input lazily, returning references into the original buffer

Source

fn remaining(&self) -> &'a [u8]

Get the remaining unparsed bytes

Source

fn is_complete(&self) -> bool

Check if parsing is complete

Source

fn reset(&mut self)

Reset parser state for reuse

Implementors§