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.
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.
Modules
Structs
Enums
- CParameter A compression parameter.
- DParameter A decompression parameter.
- ResetDirective What kind of context reset should be applied.
- Strategy
Traits
-
WriteBuf
Describe a bytes container, like
Vec<u8>.
Functions
-
compress
Wraps the
ZSTD_compressfunction. - compress_bound Maximum compressed size in worst case single-pass scenario
-
compress_using_cdict
Wraps the
ZSTD_compress_usingCDict()function. -
create_cdict
Wraps the
ZSTD_createCDict()function. -
create_cstream
Allocates a new
CStream. -
create_ddict
Wraps the
ZSTD_createDDict()function. -
decompress
Wraps the
ZSTD_decompressfunction. -
decompress_using_ddict
Wraps the
ZSTD_decompress_usingDDict()function. -
find_frame_compressed_size
Wraps the
ZSTD_findFrameCompressedSize()function. -
get_decompressed_size
Wraps the
ZSTD_getDecompressedSizefunction. -
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 Returns the error string associated with an error code.
-
get_frame_content_size
Wraps the
ZSTD_getFrameContentSize()function. -
init_cstream
Prepares an existing
CStreamfor compression at the given level. - max_c_level Returns the maximum (slowest) compression level supported.
- min_c_level Returns the minimum (fastest) compression level supported.
- version_number Returns the ZSTD version.
- version_string Returns a string representation of the ZSTD version.
Type Aliases
- CStream Compression stream.
- CompressionLevel Represents the compression level used by zstd.
- DStream A Decompression stream.
- ErrorCode Represents a possible error from the zstd library.
- SafeResult Wrapper result around most zstd functions.