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 context
- Compression dictionary.
- Indicates an error happened when parsing the frame content size.
- A Decompression Context.
- A digested decompression dictionary.
- Wrapper around an input buffer.
- Wrapper around an output buffer.
Enums§
- A compression parameter.
- A decompression parameter.
- Dict
Attach Pref experimental
- Frame
Format experimental
- Param
Switch experimental
- What kind of context reset should be applied.
- How to compress data. Advanced compression API (Requires v1.4.0+)
Constants§
Traits§
- Describe a bytes container, like
Vec<u8>
.
Functions§
- Wraps the
ZSTD_compress
function. - Maximum compressed size in worst case single-pass scenario
- Wraps the
ZSTD_compress_usingCDict()
function. - Wraps the
ZSTD_createCDict()
function. - Allocates a new
CStream
. - Wraps the
ZSTD_createDDict()
function. - Wraps the
ZSTD_decompress
function. - decompress_
bound experimental
Wraps theZSTD_decompressBound
function - Wraps the
ZSTD_decompress_usingDDict()
function. - decompression_
margin experimental
Returns the minimum extra space when output and input buffer overlap. - find_
decompressed_ size experimental
Wraps theZSTD_findDecompressedSize()
function. - Wraps the
ZSTD_findFrameCompressedSize()
function. - get_
block_ size experimental
Wraps theZSTD_getBlockSize()
function. - get_
decompressed_ size Deprecated Wraps theZSTD_getDecompressedSize
function. - get_
dict_ id zdict_builder
Wraps theZDICT_getDictID()
function. - Wraps the
ZSTD_getDictID_fromDict()
function. - Wraps the
ZSTD_getDictID_fromFrame()
function. - Returns the error string associated with an error code.
- Wraps the
ZSTD_getFrameContentSize()
function. - Prepares an existing
CStream
for compression at the given level. - is_
frame experimental
Wraps theZSTD_isFrame()
function. - Returns the maximum (slowest) compression level supported.
- Returns the minimum (fastest) compression level supported.
- sequence_
bound experimental
Given a buffer of sizesrc_size
, returns the maximum number of sequences that can ge generated. - train_
from_ buffer zdict_builder
Wraps theZDICT_trainFromBuffer()
function. - Returns the ZSTD version.
- Returns a string representation of the ZSTD version.
Type Aliases§
- 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.