pub struct JsonArrayCodec<T> { /* private fields */ }Available on crate feature
json only.Expand description
A Decoder that yields the elements of a JSON array.
Implementations§
Source§impl<T> JsonArrayCodec<T>
impl<T> JsonArrayCodec<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 element longer than max_length bytes.
Trait Implementations§
Source§impl<T: Clone> Clone for JsonArrayCodec<T>
impl<T: Clone> Clone for JsonArrayCodec<T>
Source§fn clone(&self) -> JsonArrayCodec<T>
fn clone(&self) -> JsonArrayCodec<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for JsonArrayCodec<T>
impl<T: Debug> Debug for JsonArrayCodec<T>
Source§impl<T> Decoder for JsonArrayCodec<T>where
T: for<'de> Deserialize<'de>,
impl<T> Decoder for JsonArrayCodec<T>where
T: for<'de> Deserialize<'de>,
Source§type Item = Result<T, StreamError>
type Item = Result<T, StreamError>
Always Ok(_): every failure this format can have is terminal, because the cursor
tracks nesting across records and cannot resynchronise after a bad one.
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 JsonArrayCodec<T>
impl<T> RefUnwindSafe for JsonArrayCodec<T>
impl<T> Send for JsonArrayCodec<T>
impl<T> Sync for JsonArrayCodec<T>
impl<T> Unpin for JsonArrayCodec<T>
impl<T> UnsafeUnpin for JsonArrayCodec<T>
impl<T> UnwindSafe for JsonArrayCodec<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