pub struct PushParser<'input, 'scratch, H, C>where
C: BitStackConfig,{ /* private fields */ }Expand description
A SAX-style JSON push parser.
Generic over BitStack storage type for configurable nesting depth. Parsing events are returned to the handler.
§Generic Parameters
'scratch- Lifetime for the scratch buffer used for temporary storageH- The event handler type that implementsPushParserHandlerC- BitStack configuration type that implementsBitStackConfig
Implementations§
Source§impl<'input, 'scratch, H, C> PushParser<'input, 'scratch, H, C>where
C: BitStackConfig,
impl<'input, 'scratch, H, C> PushParser<'input, 'scratch, H, C>where
C: BitStackConfig,
Sourcepub fn write<E>(&mut self, data: &'input [u8]) -> Result<(), PushParseError<E>>
pub fn write<E>(&mut self, data: &'input [u8]) -> Result<(), PushParseError<E>>
Processes a chunk of input data.
Sourcepub fn finish<E>(self) -> Result<H, PushParseError<E>>where
H: for<'a, 'b> PushParserHandler<'a, 'b, E>,
pub fn finish<E>(self) -> Result<H, PushParseError<E>>where
H: for<'a, 'b> PushParserHandler<'a, 'b, E>,
Finishes parsing, flushes any remaining events, and returns the handler. This method consumes the parser.
Auto Trait Implementations§
impl<'input, 'scratch, H, C> Freeze for PushParser<'input, 'scratch, H, C>
impl<'input, 'scratch, H, C> RefUnwindSafe for PushParser<'input, 'scratch, H, C>where
H: RefUnwindSafe,
<C as BitStackConfig>::Counter: RefUnwindSafe,
<C as BitStackConfig>::Bucket: RefUnwindSafe,
impl<'input, 'scratch, H, C> Send for PushParser<'input, 'scratch, H, C>
impl<'input, 'scratch, H, C> Sync for PushParser<'input, 'scratch, H, C>
impl<'input, 'scratch, H, C> Unpin for PushParser<'input, 'scratch, H, C>
impl<'input, 'scratch, H, C> !UnwindSafe for PushParser<'input, 'scratch, H, C>
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