Skip to main content

decode_frame

Function decode_frame 

Source
pub fn decode_frame(
    input: &[u8],
    max_frame_size: u32,
) -> Result<(Frame<'_>, usize), Http2Error>
Expand description

Decodes a frame from a byte slice. Spec §4.1.

Returns the frame and the number of bytes consumed (header + payload).

§Errors

  • ShortFrameHeader if fewer than 9 bytes are available.
  • ShortPayload if the length is larger than the available buffer.
  • FrameTooLarge if the length exceeds max_frame_size.
  • UnknownFrameType if the type byte is not recognized.