pub fn decode_frame<T: for<'de> Deserialize<'de>>(
buf: &[u8],
) -> Result<(T, usize), FrameError>Expand description
Decode a length-prefixed frame into a deserialized value. Returns the value and the number of bytes consumed.
ยงErrors
Returns FrameError::Incomplete if the buffer is too short,
FrameError::Oversized if the declared length exceeds 10 MB,
or FrameError::Json if deserialization fails.