pub trait Codec {
type EncodeOptions;
type DecodeOptions;
// Required methods
fn encode(
data: &[u8],
options: &Self::EncodeOptions,
) -> Result<Vec<u8>, Error>;
fn decode(
data: &[u8],
options: &Self::DecodeOptions,
) -> Result<Vec<u8>, Error>;
}Required Associated Types§
type EncodeOptions
type DecodeOptions
Required Methods§
fn encode(data: &[u8], options: &Self::EncodeOptions) -> Result<Vec<u8>, Error>
fn decode(data: &[u8], options: &Self::DecodeOptions) -> Result<Vec<u8>, Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".