pub struct JsonStreamParser { /* private fields */ }Expand description
A simple streaming JSON parser that processes a JSON array element by element.
Feeds chunks of text and emits complete JSON values as they are parsed.
Implementations§
Source§impl JsonStreamParser
impl JsonStreamParser
Sourcepub fn feed(&mut self, chunk: &str) -> usize
pub fn feed(&mut self, chunk: &str) -> usize
Feed a chunk of text to the parser. Returns the number of complete values parsed from this chunk.
Sourcepub fn take_results(&mut self) -> Vec<JsonValue>
pub fn take_results(&mut self) -> Vec<JsonValue>
Take all parsed values, leaving the internal store empty.
Sourcepub fn result_count(&self) -> usize
pub fn result_count(&self) -> usize
Number of complete values parsed so far.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsonStreamParser
impl RefUnwindSafe for JsonStreamParser
impl Send for JsonStreamParser
impl Sync for JsonStreamParser
impl Unpin for JsonStreamParser
impl UnsafeUnpin for JsonStreamParser
impl UnwindSafe for JsonStreamParser
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.