Struct daemon_engine::codecs::json::JsonCodec
source · pub struct JsonCodec<ENC, DEC, ERR> { /* private fields */ }Expand description
A codec for JSON encoding and decoding ENC is the type to encode, DEC is the type to decode, ERR is the error type to be returned for both operations
Implementations§
Trait Implementations§
source§impl<ENC, DEC, ERR> Decoder for JsonCodec<ENC, DEC, ERR>where
for<'de> DEC: Deserialize<'de> + Clone + Send + 'static,
for<'de> ENC: Serialize + Clone + Send + 'static,
ERR: From<Error> + From<Error> + 'static,
impl<ENC, DEC, ERR> Decoder for JsonCodec<ENC, DEC, ERR>where
for<'de> DEC: Deserialize<'de> + Clone + Send + 'static,
for<'de> ENC: Serialize + Clone + Send + 'static,
ERR: From<Error> + From<Error> + 'static,
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, ERR> Default for JsonCodec<ENC, DEC, ERR>where
for<'de> DEC: Deserialize<'de> + Clone + Send + 'static,
for<'de> ENC: Serialize + Clone + Send + 'static,
ERR: From<Error> + From<Error> + 'static,
impl<ENC, DEC, ERR> Default for JsonCodec<ENC, DEC, ERR>where
for<'de> DEC: Deserialize<'de> + Clone + Send + 'static,
for<'de> ENC: Serialize + Clone + Send + 'static,
ERR: From<Error> + From<Error> + 'static,
Default impl required for use with connections
source§impl<ENC, DEC, ERR> Encoder for JsonCodec<ENC, DEC, ERR>where
for<'de> DEC: Deserialize<'de> + Clone + Send + 'static,
for<'de> ENC: Serialize + Clone + Send + 'static,
ERR: From<Error> + From<Error> + 'static,
impl<ENC, DEC, ERR> Encoder for JsonCodec<ENC, DEC, ERR>where
for<'de> DEC: Deserialize<'de> + Clone + Send + 'static,
for<'de> ENC: Serialize + Clone + Send + 'static,
ERR: From<Error> + From<Error> + 'static,
Encoder impl encodes object streams to bytes