pub struct JsonCodec<Enc, Dec, E> { /* private fields */ }
Expand description
A codec for JSON encoding and decoding Enc is the type to encode, Dec is the type to decode, E is the error type to be returned for both operations
Implementations§
Trait Implementations§
Source§impl<Enc, Dec, E> Clone for JsonCodec<Enc, Dec, E>
Clone impl required for use with connections
impl<Enc, Dec, E> Clone for JsonCodec<Enc, Dec, E>
Clone impl required for use with connections
Source§impl<Enc, Dec, E> Decoder for JsonCodec<Enc, Dec, E>
Decoder impl parses json objects from bytes
impl<Enc, Dec, E> Decoder for JsonCodec<Enc, Dec, E>
Decoder impl parses json objects from bytes
Source§fn decode(
&mut self,
buf: &mut BytesMut,
) -> Result<Option<Self::Item>, Self::Error>
fn decode( &mut self, buf: &mut BytesMut, ) -> Result<Option<Self::Item>, Self::Error>
Attempts to decode a frame from the provided buffer of bytes. Read more
Source§impl<Enc, Dec, E> Encoder for JsonCodec<Enc, Dec, E>
Encoder impl encodes object streams to bytes
impl<Enc, Dec, E> Encoder for JsonCodec<Enc, Dec, E>
Encoder impl encodes object streams to bytes
impl<Enc, Dec, E> StructuralPartialEq for JsonCodec<Enc, Dec, E>
Auto Trait Implementations§
impl<Enc, Dec, E> Freeze for JsonCodec<Enc, Dec, E>
impl<Enc, Dec, E> RefUnwindSafe for JsonCodec<Enc, Dec, E>
impl<Enc, Dec, E> Send for JsonCodec<Enc, Dec, E>
impl<Enc, Dec, E> Sync for JsonCodec<Enc, Dec, E>
impl<Enc, Dec, E> Unpin for JsonCodec<Enc, Dec, E>
impl<Enc, Dec, E> UnwindSafe for JsonCodec<Enc, Dec, E>
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