Skip to main content

parse_packet

Function parse_packet 

Source
pub fn parse_packet(
    data: &[u8],
    self_delimited: bool,
) -> Result<(u8, Vec<(usize, usize)>, usize), Error>
Expand description

Split data into its frames. Returns (toc, frame byte-ranges, packet_offset). self_delimited parses the trailing length prefix used by multistream.

§Errors

Error::InvalidPacket if the packet violates RFC 6716 §3 framing (truncated lengths, frame sizes beyond the payload, bad padding).