pub struct NdjsonFramer { /* private fields */ }Expand description
Splits nonempty newline-delimited payloads without validating JSON.
A nonempty unterminated last line is available through Self::finish.
Implementations§
Source§impl NdjsonFramer
impl NdjsonFramer
Sourcepub fn new() -> NdjsonFramer
pub fn new() -> NdjsonFramer
A framer at the start of a stream.
Sourcepub fn push(&mut self, chunk: &[u8]) -> Drain<'_, Vec<u8>> ⓘ
pub fn push(&mut self, chunk: &[u8]) -> Drain<'_, Vec<u8>> ⓘ
Feed one transport chunk; yields every line it completed. Blank lines are not frames.
Trait Implementations§
Source§impl Debug for NdjsonFramer
impl Debug for NdjsonFramer
Source§impl Default for NdjsonFramer
impl Default for NdjsonFramer
Source§fn default() -> NdjsonFramer
fn default() -> NdjsonFramer
Returns the “default value” for a type. Read more
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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