pub struct NdJsonParser { /* private fields */ }Expand description
Parser for Newline-Delimited JSON streams
Implementations§
Source§impl NdJsonParser
impl NdJsonParser
Sourcepub fn new() -> NdJsonParser
pub fn new() -> NdJsonParser
Create a new NDJSON parser with default options
Sourcepub fn with_options(options: ParserOptions) -> NdJsonParser
pub fn with_options(options: ParserOptions) -> NdJsonParser
Create a new NDJSON parser with custom options
Sourcepub fn feed(&mut self, chunk: &str) -> Result<Vec<Value>, Error>
pub fn feed(&mut self, chunk: &str) -> Result<Vec<Value>, Error>
Feed a chunk of input to the parser
Sourcepub fn finish(&mut self) -> Result<Vec<Value>, Error>
pub fn finish(&mut self) -> Result<Vec<Value>, Error>
Finish parsing and return any remaining values
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Check if the parser has finished
Sourcepub fn line_number(&self) -> usize
pub fn line_number(&self) -> usize
Get the current line number
Trait Implementations§
Source§impl Default for NdJsonParser
impl Default for NdJsonParser
Source§fn default() -> NdJsonParser
fn default() -> NdJsonParser
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NdJsonParser
impl RefUnwindSafe for NdJsonParser
impl Send for NdJsonParser
impl Sync for NdJsonParser
impl Unpin for NdJsonParser
impl UnsafeUnpin for NdJsonParser
impl UnwindSafe for NdJsonParser
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more