Expand description

Minimal safe wrapper around zstd-sys.

This crates provides a minimal translation of the zstd-sys methods. For a more comfortable high-level library, see the zstd crate.

Most of the functions here map 1-for-1 to a function from the C zstd library mentioned in their descriptions. Check the source documentation for more information on their behaviour.

Features denoted as experimental in the C library are hidden behind an experimental feature.

Re-exports

pub use zstd_sys;

Structs

Compression dictionary.

A Decompression Context.

A digested decompression dictionary.

Wrapper around an input buffer.

Wrapper around an output buffer.

Enums

A compression parameter.

A decompression parameter.

DictAttachPrefexperimental
FrameFormatexperimental
ParamSwitchexperimental

Reset directive.

How to compress data. Advanced compression API (Requires v1.4.0+)

Constants

Traits

Describe a resizeable bytes container like Vec<u8>.

Functions

Wraps the ZSTD_CCtx_loadDictionary() function.

Wraps the ZSTD_CCtx_refCDict() function.

Wraps the ZSTD_CCtx_refPrefix() function.

Wraps the ZSTD_CCtx_reset() function.

Wraps the ZSTD_CCtx_setParameter() function.

Wraps the ZSTD_CCtx_setPledgedSrcSize() function.

Wraps the ZSTD_compress function.

Wraps the ZSTD_compress2() function.

compress_blockexperimental

Wraps the ZSTD_compressBlock() function.

maximum compressed size in worst case single-pass scenario

Wraps the ZSTD_compressCCtx() function

Wraps the ZSTD_compressStream() function.

Wraps the ZSTD_compress_usingCDict() function.

Wraps the ZSTD_compress_usingDict() function.

Wraps the ZSTD_createCDict() function.

Wraps the ZSTD_createCDict_byReference() function.

Allocates a new CStream.

Prepares a new decompression context without dictionary.

Wraps the ZSTD_createDDict() function.

Wraps the ZSTD_createDDict_byReference() function.

Wraps ZSTD_CStreamInSize()

Wraps ZSTD_CStreamOutSize()

Wraps the ZSTD_DCtx_loadDictionary() function.

Wraps the ZSTD_DCtx_refDDict() function.

Wraps the ZSTD_DCtx_refPrefix() function.

Wraps the ZSTD_DCtx_reset() function.

Wraps the ZSTD_DCtx_setParameter() function.

Wraps the ZSTD_decompress function.

decompress_blockexperimental

Wraps the ZSTD_decompressBlock() function.

decompress_boundexperimental

Wraps the ZSTD_decompressBound function

Wraps the ZSTD_decompressDCtx() function.

Wraps the ZSTD_decompressStream() function.

Wraps the ZSTD_decompress_usingDDict() function.

Wraps the ZSTD_decompress_usingDict() function.

Wraps the ZSTD_DStreamInSize() function.

Wraps the ZSTD_DStreamOutSize() function.

Wraps the ZSTD_endStream() function.

Wraps the ZSTD_findDecompressedSize() function.

Wraps the ZSTD_findFrameCompressedSize() function.

Wraps the ZSTD_flushStream() function.

get_block_sizeexperimental

Wraps the ZSTD_getBlockSize() function.

Wraps the ZSTD_getDecompressedSize function.

get_dict_idzdict_builder

Wraps the ZSTD_getDictID_fromDict() function.

Wraps the ZSTD_getDictID_fromDDict() function.

Wraps the ZSTD_getDictID_fromDict() function.

Wraps the ZSTD_getDictID_fromFrame() function.

Wraps the ZSTD_getFrameContentSize() function.

Prepares an existing CStream for compression at the given level.

init_cstream_src_sizeDeprecatedexperimental

Wraps the ZSTD_initCStream_srcSize() function.

init_cstream_using_cdictDeprecatedexperimental

Wraps the ZSTD_initCStream_usingCDict() function.

init_cstream_using_dictDeprecatedexperimental

Wraps the ZSTD_initCStream_usingDict() function.

Wraps the ZSTD_initCStream() function.

init_dstream_using_ddictDeprecatedexperimental

Wraps the ZSTD_initDStream_usingDDict() function.

init_dstream_using_dictDeprecatedexperimental

Wraps the ZSTD_initDStream_usingDict() function.

insert_blockexperimental

Wraps the ZSTD_insertBlock() function.

is_frameexperimental

Wraps the ZSTD_isFrame() function.

Returns the maximum (slowest) compression level supported.

Returns the minimum (fastest) compression level supported.

reset_cstreamDeprecatedexperimental

Wraps the ZSTD_resetCStream() function.

reset_dstreamexperimental

Wraps the ZSTD_resetDStream() function.

Wraps the ZSTD_sizeofCCtx() function.

Wraps the ZSTD_sizeof_CDict() function.

Wraps the ZSTD_sizeof_CStream() function.

Wraps the ZSTD_sizeof_DCtx() function.

Wraps the ZSTD_sizeof_DDict() function.

Wraps the ZSTD_sizeof_DStream() function.

train_from_bufferzdict_builder

Wraps the ZDICT_trainFromBuffer() function.

Type Definitions

Compression stream.

Represents the compression level used by zstd.

A Decompression stream.

Represents a possible error from the zstd library.

Wrapper result around most zstd functions.