pub trait Codec {
type EncodeError: Error + Send + Sync + 'static;
type DecodeError: Error + Send + Sync + 'static;
const EXTENSION: &'static str;
// Required methods
fn encode(
writer: impl Write,
profile: &Profile<'_>,
) -> Result<(), Self::EncodeError>;
fn decode(slice: &[u8]) -> Result<Profile<'_>, Self::DecodeError>;
}Expand description
A codec for encoding and decoding profiles.
Required Associated Constants§
Required Associated Types§
Sourcetype EncodeError: Error + Send + Sync + 'static
type EncodeError: Error + Send + Sync + 'static
The error type for encoding.
Sourcetype DecodeError: Error + Send + Sync + 'static
type DecodeError: Error + Send + Sync + 'static
The error type for decoding.
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.