pub trait Decode: Sized {
const MIN_SIZE: usize = 0;
// Required method
fn decode(data: &[u8]) -> Option<(Self, usize)>;
}Expand description
Decode a value from a byte slice in conduit’s binary wire format.
Returns the decoded value together with the number of bytes consumed,
or None if the data is too short or malformed.
Provided Associated Constants§
Sourceconst MIN_SIZE: usize = 0
const MIN_SIZE: usize = 0
Minimum number of bytes required to attempt decoding this type.
For fixed-size types (primitives), this equals the exact encoded size. For variable-size types (String, Vec), this is the minimum (the length prefix size). Used by derived impls for an upfront bounds check.
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.