pub trait Codec{
type Payload;
// Required methods
fn encode(&self, payload: &Self::Payload) -> Result<Vec<u8>>;
fn decode(&self, encoded_value: &[u8]) -> Result<Self::Payload>;
}Expand description
A pluggable payload encoder/decoder.
See the module-level documentation for detailed guidance and examples.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.