pub trait ByteDecodable: Sized {
// Required method
fn decode<Size>(bytes: &[u8]) -> BVDecodeResult<Self>
where Size: BVSize + ByteDecodable;
// Provided method
fn decode_max<Size>(bytes: &[u8], limit: Size) -> BVDecodeResult<Self>
where Size: BVSize + ByteDecodable { ... }
}Expand description
Provides deserialization functionality for the implementing types.
Required Methods§
Sourcefn decode<Size>(bytes: &[u8]) -> BVDecodeResult<Self>where
Size: BVSize + ByteDecodable,
fn decode<Size>(bytes: &[u8]) -> BVDecodeResult<Self>where
Size: BVSize + ByteDecodable,
Returns an instance of Self obtained from the deserialization of the provided byte buffer.
Provided Methods§
Sourcefn decode_max<Size>(bytes: &[u8], limit: Size) -> BVDecodeResult<Self>where
Size: BVSize + ByteDecodable,
fn decode_max<Size>(bytes: &[u8], limit: Size) -> BVDecodeResult<Self>where
Size: BVSize + ByteDecodable,
Returns the result of decode if bytes.len() is less or equal than limit
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.