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§
- CCtx
- CDict
- Compression dictionary.
- DCtx
- A Decompression Context.
- DDict
- A digested decompression dictionary.
- InBuffer
- Wrapper around an input buffer.
- OutBuffer
- Wrapper around an output buffer.
Enums§
- CParameter
- A compression parameter.
- DParameter
- A decompression parameter.
- Reset
Directive - Reset directive.
- Strategy
- How to compress data. Advanced compression API (Requires v1.4.0+)
Constants§
- BLOCKSIZELOG_
MAX - BLOCKSIZE_
MAX - CLEVEL_
DEFAULT - CONTENTSIZE_
ERROR - CONTENTSIZE_
UNKNOWN - MAGICNUMBER
- MAGIC_
DICTIONARY - MAGIC_
SKIPPABLE_ MASK - MAGIC_
SKIPPABLE_ START - VERSION_
MAJOR - VERSION_
MINOR - VERSION_
NUMBER - VERSION_
RELEASE
Traits§
- Write
Buf - Describe a resizeable bytes container like
Vec<u8>
.
Functions§
- cctx_
load_ dictionary - Wraps the
ZSTD_CCtx_loadDictionary()
function. - cctx_
ref_ cdict - Wraps the
ZSTD_CCtx_refCDict()
function. - cctx_
ref_ prefix - Wraps the
ZSTD_CCtx_refPrefix()
function. - cctx_
reset - Wraps the
ZSTD_CCtx_reset()
function. - cctx_
set_ parameter - Wraps the
ZSTD_CCtx_setParameter()
function. - cctx_
set_ pledged_ src_ size - Wraps the
ZSTD_CCtx_setPledgedSrcSize()
function. - compress
- Wraps the
ZSTD_compress
function. - compress2
- Wraps the
ZSTD_compress2()
function. - compress_
bound - maximum compressed size in worst case single-pass scenario
- compress_
cctx - Wraps the
ZSTD_compressCCtx()
function - compress_
stream - Wraps the
ZSTD_compressStream()
function. - compress_
stream2 - compress_
using_ cdict - Wraps the
ZSTD_compress_usingCDict()
function. - compress_
using_ dict - Wraps the
ZSTD_compress_usingDict()
function. - create_
cctx - create_
cdict - Wraps the
ZSTD_createCDict()
function. - create_
cstream - Allocates a new
CStream
. - create_
dctx - Prepares a new decompression context without dictionary.
- create_
ddict - Wraps the
ZSTD_createDDict()
function. - create_
dstream - cstream_
in_ size - Wraps
ZSTD_CStreamInSize()
- cstream_
out_ size - Wraps
ZSTD_CStreamOutSize()
- dctx_
load_ dictionary - Wraps the
ZSTD_DCtx_loadDictionary()
function. - dctx_
ref_ ddict - Wraps the
ZSTD_DCtx_refDDict()
function. - dctx_
ref_ prefix - Wraps the
ZSTD_DCtx_refPrefix()
function. - dctx_
reset - Wraps the
ZSTD_DCtx_reset()
function. - dctx_
set_ parameter - Wraps the
ZSTD_DCtx_setParameter()
function. - decompress
- Wraps the
ZSTD_decompress
function. - decompress_
dctx - Wraps the
ZSTD_decompressDCtx()
function. - decompress_
stream - Wraps the
ZSTD_decompressStream()
function. - decompress_
using_ ddict - Wraps the
ZSTD_decompress_usingDDict()
function. - decompress_
using_ dict - Wraps the
ZSTD_decompress_usingDict()
function. - dstream_
in_ size - Wraps the
ZSTD_DStreamInSize()
function. - dstream_
out_ size - Wraps the
ZSTD_DStreamOutSize()
function. - end_
stream - Wraps the
ZSTD_endStream()
function. - find_
frame_ compressed_ size - Wraps the
ZSTD_findFrameCompressedSize()
function. - flush_
stream - Wraps the
ZSTD_flushStream()
function. - get_
decompressed_ size Deprecated - Wraps the
ZSTD_getDecompressedSize
function. - get_
dict_ id - Wraps the
ZSTD_getDictID_fromDict()
function. - get_
dict_ id_ from_ ddict - Wraps the
ZSTD_getDictID_fromDDict()
function. - get_
dict_ id_ from_ dict - Wraps the
ZSTD_getDictID_fromDict()
function. - get_
dict_ id_ from_ frame - Wraps the
ZSTD_getDictID_fromFrame()
function. - get_
error_ name - get_
frame_ content_ size - Wraps the
ZSTD_getFrameContentSize()
function. - init_
cstream - Prepares an existing
CStream
for compression at the given level. - init_
dstream - Wraps the
ZSTD_initCStream()
function. - max_
c_ level - Returns the maximum (slowest) compression level supported.
- min_
c_ level - Returns the minimum (fastest) compression level supported.
- sizeof_
cctx - Wraps the
ZSTD_sizeofCCtx()
function. - sizeof_
cdict - Wraps the
ZSTD_sizeof_CDict()
function. - sizeof_
cstream - Wraps the
ZSTD_sizeof_CStream()
function. - sizeof_
dctx - Wraps the
ZSTD_sizeof_DCtx()
function. - sizeof_
ddict - Wraps the
ZSTD_sizeof_DDict()
function. - sizeof_
dstream - Wraps the
ZSTD_sizeof_DStream()
function. - train_
from_ buffer - Wraps the
ZDICT_trainFromBuffer()
function. - version_
number - version_
string
Type Aliases§
- CStream
- Compression stream.
- Compression
Level - Represents the compression level used by zstd.
- DStream
- A Decompression stream.
- Error
Code - Represents a possible error from the zstd library.
- Safe
Result - Wrapper result around most zstd functions.