Crate zstd_safe [] [src]

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.

Introduction

zstd, short for Zstandard, is a fast lossless compression algorithm, targeting real-time compression scenarios at zlib-level and better compression ratios. The zstd compression library provides in-memory compression and decompression functions. The library supports compression levels from 1 up to ZSTD_maxCLevel() which is 22. Levels >= 20, labeled --ultra, should be used with caution, as they require more memory.

Compression can be done in:

  • a single step (described as Simple API)
  • a single step, reusing a context (described as Explicit memory management)
  • unbounded multiple steps (described as Streaming compression)

The compression ratio achievable on small data can be highly improved using compression with a dictionary in:

  • a single step (described as Simple dictionary API)
  • a single step, reusing a dictionary (described as Fast dictionary API)

Advanced experimental functions can be accessed using #define ZSTD_STATIC_LINKING_ONLY before including zstd.h. These APIs shall never be used with a dynamic library. They are not "stable", their definition may change in the future. Only static linking is allowed.

Structs

CCtx
CDict
CStream
DCtx
DDict
DStream
InBuffer
OutBuffer

Functions

ceate_ddict

ZSTD_createDDict()

compress

ZSTD_compress

compress_block
compress_bound
compress_cctx

ZSTD_compressCCtx()

compress_stream
compress_using_cdict

ZSTD_compress_usingCDict()

compress_using_dict

ZSTD_compress_usingDict()

create_cctx
create_cdict

ZSTD_createCDict()

create_cdict_by_reference

ZSTD_createCDict_byReference()

create_cstream
create_dctx
create_ddict_by_reference

ZSTD_createDDict_byReference()

create_dstream
cstream_in_size
cstream_out_size
decompress

ZSTD_decompress

decompress_block
decompress_dctx

ZSTD_decompressDCtx()

decompress_stream
decompress_using_ddict

ZSTD_decompress_usingDDict()

decompress_using_dict

ZSTD_decompress_usingDict()

dstream_in_size
dstream_out_size
end_stream
find_decompressed_size

ZSTD_findDecompressedSize()

find_frame_compressed_size

ZSTD_findFrameCompressedSize()

flush_stream
get_block_size
get_decompressed_size

ZSTD_getDecompressedSize()

get_dict_id_from_ddict

ZSTD_getDictID_fromDDict()

get_dict_id_from_dict

ZSTD_getDictID_fromDict()

get_dict_id_from_frame

ZSTD_getDictID_fromFrame()

get_error_name
get_frame_content_size

ZSTD_getFrameContentSize()

init_cstream
init_cstream_src_size
init_cstream_using_csict
init_cstream_using_dict
init_dstream
init_dstream_using_ddict
init_dstream_using_dict
insert_block
is_error
is_frame

ZSTD_isFrame()

max_clevel
reset_cstream

ZSTD_resetCStream()

reset_dstream
sizeof_cctx

ZSTD_sizeofCCtx()

sizeof_cdict

ZSTD_sizeof_CDict()

sizeof_cstream
sizeof_dctx

ZSTD_sizeof_DCtx()

sizeof_ddict

ZSTD_sizeof_DDict()

sizeof_dstream
train_from_buffer

ZDICT_trainFromBuffer()

version_number