pub struct JsonNewLineCodec<T> { /* private fields */ }Available on crate feature
json only.Expand description
A Decoder that yields one deserialised item per line.
Implementations§
Source§impl<T> JsonNewLineCodec<T>
impl<T> JsonNewLineCodec<T>
Sourcepub fn new_with_max_length(max_length: usize) -> Self
pub fn new_with_max_length(max_length: usize) -> Self
A codec that rejects any single line longer than max_length bytes.
Trait Implementations§
Source§impl<T: Debug> Debug for JsonNewLineCodec<T>
impl<T: Debug> Debug for JsonNewLineCodec<T>
Source§impl<T> Decoder for JsonNewLineCodec<T>where
T: for<'de> Deserialize<'de>,
impl<T> Decoder for JsonNewLineCodec<T>where
T: for<'de> Deserialize<'de>,
Source§type Item = Result<T, StreamError>
type Item = Result<T, StreamError>
The type of decoded frames.
Source§type Error = StreamError
type Error = StreamError
The type of unrecoverable frame decoding errors. Read more
Source§fn decode(
&mut self,
buf: &mut BytesMut,
) -> Result<Option<Self::Item>, StreamError>
fn decode( &mut self, buf: &mut BytesMut, ) -> Result<Option<Self::Item>, StreamError>
Attempts to decode a frame from the provided buffer of bytes. Read more
Source§fn decode_eof(
&mut self,
buf: &mut BytesMut,
) -> Result<Option<Self::Item>, StreamError>
fn decode_eof( &mut self, buf: &mut BytesMut, ) -> Result<Option<Self::Item>, StreamError>
A default method available to be called when there are no more bytes
available to be read from the underlying I/O. Read more
Auto Trait Implementations§
impl<T> Freeze for JsonNewLineCodec<T>
impl<T> RefUnwindSafe for JsonNewLineCodec<T>
impl<T> Send for JsonNewLineCodec<T>
impl<T> Sync for JsonNewLineCodec<T>
impl<T> Unpin for JsonNewLineCodec<T>
impl<T> UnsafeUnpin for JsonNewLineCodec<T>
impl<T> UnwindSafe for JsonNewLineCodec<T>
Blanket Implementations§
impl<T> Allocation for T
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