Skip to main content

decode_from_slice

Function decode_from_slice 

Source
pub fn decode_from_slice<T: DeserializeOwned>(
    bytes: &[u8],
) -> Result<T, CodecError>
Expand description

Decodes a T from a complete framed codec buffer.

Validates the frame header, decodes the body positionally, then requires the input to be fully consumed.

ยงErrors

Returns CodecError on a bad or short header, malformed body, a self-describing deserialize request, or unconsumed trailing bytes.