pub trait DecodeBinary: Sized {
type Error;
// Required method
fn decode_binary(bytes: &[u8]) -> Result<Self, Self::Error>;
}Expand description
Minimal decode trait for binary format value types.
Required Associated Types§
Required Methods§
Sourcefn decode_binary(bytes: &[u8]) -> Result<Self, Self::Error>
fn decode_binary(bytes: &[u8]) -> Result<Self, Self::Error>
Decodes a value from raw bytes.
§Errors
Self::Error, on terms the implementing format decides. Trailing
bytes past the value are the implementation’s to accept or refuse.
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.