Skip to main content

decompress

Function decompress 

Source
pub fn decompress(data: &[u8], capacity: usize) -> Result<Vec<u8>>
Expand description

Decompresses a block of data and returns the decompressed result.

The decompressed data should be at most capacity bytes, or an error will be returned - so capacity is the most you are willing to allocate for this, not a guess that has to be right. When the frame records its size, only that much is allocated however large a capacity you allow.

crate::decompressed_size() gives you that size up front, if you would rather decide for yourself.