pub struct NdjsonDecoder { /* private fields */ }Expand description
Incremental newline-delimited JSON decoder.
Each complete line is returned verbatim as one record string (parsing is the
caller’s job). A partial final line is buffered until a later push completes
it or flush is called. Blank lines are skipped.
An optional per-line size limit guards against an unbounded buffered line on
an adversarial stream; exceeding it fails closed with
NetError::OversizeBody.
Implementations§
Source§impl NdjsonDecoder
impl NdjsonDecoder
Sourcepub fn with_max_line_bytes(max_line_bytes: usize) -> Self
pub fn with_max_line_bytes(max_line_bytes: usize) -> Self
Create a decoder that rejects any line (or buffered partial) exceeding
max_line_bytes.
Trait Implementations§
Source§impl Debug for NdjsonDecoder
impl Debug for NdjsonDecoder
Source§impl Default for NdjsonDecoder
impl Default for NdjsonDecoder
Source§fn default() -> NdjsonDecoder
fn default() -> NdjsonDecoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NdjsonDecoder
impl RefUnwindSafe for NdjsonDecoder
impl Send for NdjsonDecoder
impl Sync for NdjsonDecoder
impl Unpin for NdjsonDecoder
impl UnsafeUnpin for NdjsonDecoder
impl UnwindSafe for NdjsonDecoder
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