pub trait Decodable: Sized {
type Target;
type Error: Error + Sync + Send + 'static;
// Required method
fn decode(data: &[u8]) -> Result<Self::Target, Self::Error>;
// Provided method
fn decode_bytes(data: Bytes) -> Result<Self::Target, Self::Error> { ... }
}Expand description
Determines how a response is decoded.
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".