pub struct NdjsonFramer { /* private fields */ }Expand description
Newline-delimited record framing (NDJSON / JSON Lines) as a streaming
RecordFramer.
The framer knows nothing about JSON beyond the newline convention NDJSON
guarantees — a JSON document never contains an unescaped newline, so every
\n is an unambiguous record boundary.
Framing rules (pinned — changing any of them changes record indexes, which is a resume-compatibility break for sources that checkpoint by index):
- Records are split on
\n. Exactly one trailing\ris stripped (CRLF input); nothing else is trimmed. - Lines that are empty or all-ASCII-whitespace are skipped and do not consume a record index.
- An unterminated final line (no closing
\n) is a record.
Implementations§
Source§impl NdjsonFramer
impl NdjsonFramer
Sourcepub fn new(max_record_bytes: usize) -> NdjsonFramer
pub fn new(max_record_bytes: usize) -> NdjsonFramer
A line framer bounding each record at max_record_bytes decoded bytes.
Trait Implementations§
Source§impl Debug for NdjsonFramer
impl Debug for NdjsonFramer
Source§impl RecordFramer for NdjsonFramer
impl RecordFramer for NdjsonFramer
Auto Trait Implementations§
impl Freeze for NdjsonFramer
impl RefUnwindSafe for NdjsonFramer
impl Send for NdjsonFramer
impl Sync for NdjsonFramer
impl Unpin for NdjsonFramer
impl UnsafeUnpin for NdjsonFramer
impl UnwindSafe for NdjsonFramer
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