pub trait Codec {
// Required methods
fn encode(&self, enc: &mut Encoder) -> AzUtilResult<()>;
fn decode(dec: &mut Decoder<'_>) -> AzUtilResult<Self>
where Self: Sized;
}Expand description
Trait for encoding and decoding data types to and from byte buffers.
Required Methods§
Sourcefn encode(&self, enc: &mut Encoder) -> AzUtilResult<()>
fn encode(&self, enc: &mut Encoder) -> AzUtilResult<()>
Encodes self into the provided encoder.
Sourcefn decode(dec: &mut Decoder<'_>) -> AzUtilResult<Self>where
Self: Sized,
fn decode(dec: &mut Decoder<'_>) -> AzUtilResult<Self>where
Self: Sized,
Decodes an instance of Self from the provided decoder.