Skip to main content

decode_record

Function decode_record 

Source
pub fn decode_record(bytes: &[u8]) -> Result<(OwnedRecord, usize)>
Available on crate feature alloc only.
Expand description

Decode a single length-prefixed record frame from the front of bytes. Returns the decoded record plus the number of bytes consumed.

§Errors

  • Error::Truncated — input ended before a full frame could be read.
  • Error::InvalidFormat — length prefix would overflow, fixed fields are short, UTF-8 fields are invalid, or the body length does not match the sum of its parts.