Cargo Features

[dependencies]
zstd-safe = { version = "7.2.1", default-features = false, features = ["bindgen", "debug", "experimental", "legacy", "pkg-config", "std", "zstdmt", "thin", "arrays", "no_asm", "zdict_builder", "doc-cfg", "fat-lto", "thin-lto"] }
default = arrays, legacy, zdict_builder

These default features are set whenever zstd-safe is added without default-features = false somewhere in the dependency tree.

bindgen

Enables bindgen of zstd-sys

debug

Enables debug of zstd-sys

zstd-sys:

Enable zstd debug logs

experimental

Enables experimental of zstd-sys

zstd-sys:

Expose experimental ZSTD API

Affects zstd-safe::find_decompressed_size, zstd-safe::is_frame, zstd-safe::FrameFormat, zstd-safe::DictAttachPref, zstd-safe::ParamSwitch, zstd-safe::get_block_size, zstd-safe::decompress_bound, zstd-safe::sequence_bound, zstd-safe::decompression_margin, zstd-safe::ThreadPool

legacy default

Enables legacy of zstd-sys

zstd-sys:

Enable legacy ZSTD support (for versions < zstd-0.8)

pkg-config

Enables pkg-config of zstd-sys

zstd-sys:

Use pkg-config to build the zstd C library.

std

Implements WriteBuf for std types like Cursor and Vec.

Enables std of zstd-sys

zstdmt

Enables zstdmt of zstd-sys

zstd-sys:

Enable multi-thread support (with pthread)

Affects zstd-safe::ThreadPool

thin

Enables thin of zstd-sys

zstd-sys:

Optimize binary by size

arrays default
no_asm

Enables no_asm of zstd-sys

zstd-sys:

Disable ASM files (only on amd64 for decompression)

zdict_builder default

Enables zdict_builder of zstd-sys

zstd-sys:

Enable dictionary building (dictionary _using_ is always supported).

Affects zstd-safe::train_from_buffer, zstd-safe::get_dict_id

doc-cfg
fat-lto

These two are for cross-language LTO. Will only work if clang is used to build the C library.

Enables fat-lto of zstd-sys

thin-lto

Enables thin-lto of zstd-sys

zstd-sys:

Enable thin-lto, will fallback to fat-lto if not supported