Skip to main content

Module zstd

Module zstd 

Source
Available on crate feature zstd only.
Expand description

zstd compression and decompression using state that is reused per thread.

Creating a zstd context allocates and initializes its internal state, which can cost more than compressing or decompressing a small buffer.

Functionsยง

compress
Compresses src into a single zstd frame appended to dst.
decompress
Decompresses the zstd frames in src, appending them to dst, and returns the number of bytes appended. Fails if they do not fit in the spare capacity of dst.
decompress_prefix
Decompresses the zstd frames in src, appending the first len decompressed bytes to dst. Fails if they decompress to fewer bytes.