pub trait PullParser {
// Required method
fn next_event(&mut self) -> Result<Event<'_, '_>, ParseError>;
// Provided method
fn next(&mut self) -> Option<Result<Event<'_, '_>, ParseError>> { ... }
}
Expand description
Trait for parsers that can be used in a pull-based manner.
This trait is implemented by both SliceParser
and StreamParser
.
Required Methods§
Sourcefn next_event(&mut self) -> Result<Event<'_, '_>, ParseError>
fn next_event(&mut self) -> Result<Event<'_, '_>, ParseError>
Returns the next JSON event or an error if parsing fails.
Parsing continues until EndDocument
is returned or an error occurs.