[−][src]Crate zstd_safe
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 | |
DCtx | |
DDict | |
InBuffer | |
OutBuffer |
Enums
CParameter | |
DParameter | |
FrameFormat | |
ResetDirective | Reset directive. |
Strategy | How to compress data. |
Constants
Functions
cctx_load_dictionary |
|
cctx_ref_cdict |
|
cctx_ref_prefix |
|
cctx_reset |
|
cctx_set_parameter | Set one compression parameter, selected by enum ZSTD_cParameter. |
cctx_set_pledged_src_size |
|
compress |
|
compress2 |
|
compress_bound | maximum compressed size in worst case single-pass scenario |
compress_cctx |
|
compress_stream | |
compress_stream2 |
|
compress_using_cdict |
|
compress_using_dict |
|
create_cctx | |
create_cdict |
|
create_cstream | |
create_dctx | |
create_ddict |
|
create_dstream | |
cstream_in_size | |
cstream_out_size | |
dctx_load_dictionary |
|
dctx_ref_ddict |
|
dctx_ref_prefix |
|
dctx_reset |
|
dctx_set_parameter |
|
decompress |
|
decompress_dctx |
|
decompress_stream | |
decompress_using_ddict |
|
decompress_using_dict |
|
dstream_in_size | |
dstream_out_size | |
end_stream | |
find_frame_compressed_size |
|
flush_stream | |
get_decompressed_size |
|
get_dict_id | |
get_dict_id_from_ddict |
|
get_dict_id_from_dict |
|
get_dict_id_from_frame |
|
get_error_name | |
get_frame_content_size |
|
init_cstream | |
init_dstream | |
max_c_level | |
max_clevel | |
min_c_level | |
sizeof_cctx |
|
sizeof_cdict |
|
sizeof_cstream | |
sizeof_dctx |
|
sizeof_ddict |
|
sizeof_dstream | |
train_from_buffer |
|
version_number | |
version_string |
Type Definitions
CStream | |
DStream |