Function zstd_safe::compress [] [src]

pub fn compress(dst: &mut [u8], src: &[u8], compression_level: i32) -> usize

ZSTD_compress

Compresses src content as a single zstd compressed frame into already allocated dst.

Hint : compression runs faster if dstCapacity >= ZSTD_compressBound(srcSize).

Returns the compressed size written into dst (<= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()).