pub enum ParserState {
ExpectingSection,
InSection(SectionKind),
InEvent {
section: SectionKind,
fields_seen: usize,
},
}Available on crate feature
stream only.Expand description
Streaming parser state for incremental processing
Tracks current parsing context to handle partial data and section boundaries correctly during streaming.
Variants§
ExpectingSection
Expecting section header or document start
InSection(SectionKind)
Currently parsing a specific section
InEvent
Parsing an event with potentially incomplete data
Fields
§
section: SectionKindWhich section type we’re in
Implementations§
Source§impl ParserState
impl ParserState
Sourcepub const fn is_in_section(&self) -> bool
pub const fn is_in_section(&self) -> bool
Check if currently inside a section
Sourcepub const fn current_section(&self) -> Option<SectionKind>
pub const fn current_section(&self) -> Option<SectionKind>
Get current section kind if in a section
Sourcepub fn enter_section(&mut self, kind: SectionKind)
pub fn enter_section(&mut self, kind: SectionKind)
Transition to new section
Sourcepub fn enter_event(&mut self, section: SectionKind)
pub fn enter_event(&mut self, section: SectionKind)
Begin event parsing within section
Sourcepub fn exit_section(&mut self)
pub fn exit_section(&mut self)
Exit current section
Trait Implementations§
Source§impl Clone for ParserState
impl Clone for ParserState
Source§fn clone(&self) -> ParserState
fn clone(&self) -> ParserState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParserState
impl Debug for ParserState
Source§impl PartialEq for ParserState
impl PartialEq for ParserState
impl Eq for ParserState
impl StructuralPartialEq for ParserState
Auto Trait Implementations§
impl Freeze for ParserState
impl RefUnwindSafe for ParserState
impl Send for ParserState
impl Sync for ParserState
impl Unpin for ParserState
impl UnwindSafe for ParserState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more