Skip to main content

read_compressed_frame

Function read_compressed_frame 

Source
pub fn read_compressed_frame(
    data: &[u8],
) -> Result<(usize, &[u8]), ProtocolError>
Expand description

Decode the inner frame data when compression is enabled.

Returns (uncompressed_size, payload) where:

  • uncompressed_size == 0 means the payload is NOT compressed
  • uncompressed_size > 0 means the payload is zlib-compressed

The returned payload is a sub-slice of the input — no allocation or copy.

§Errors

Returns errors for malformed data.