pub trait Decode: Sized {
// Required method
fn decode(reader: &mut Reader<'_>) -> Result<Self, DecodeError>;
}Expand description
A type that can be read back from Cyclone bytes.
The counterpart of Encode, and the two must agree field for field: the
byte stream carries no metadata to fall back on.
Required Methods§
Sourcefn decode(reader: &mut Reader<'_>) -> Result<Self, DecodeError>
fn decode(reader: &mut Reader<'_>) -> Result<Self, DecodeError>
Reads one value from reader, advancing its cursor past it.
§Errors
Any DecodeError the underlying reads produce. On failure the cursor
is left where the failing read began.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".