structured-zstd 0.0.22

Pure Rust zstd implementation — managed fork of ruzstd. Dictionary decompression, no FFI.
Documentation
[package]
name = "structured-zstd"
version = "0.0.22"
rust-version = "1.92"
authors = [
    "Moritz Borcherding <moritz.borcherding@web.de>",
    "Structured World Foundation <foundation@sw.foundation>",
]
edition = "2024"
license = "Apache-2.0"
homepage = "https://github.com/structured-world/structured-zstd"
repository = "https://github.com/structured-world/structured-zstd"
description = "Pure Rust zstd implementation — managed fork of ruzstd. Dictionary decompression, no FFI."
exclude = ["fuzz_decodecorpus/*", "decodecorpus_files/*", "dict_tests/files/**"]
# Package metadata points at a crate-local symlink so the packaged crate and repo root README stay in sync.
readme = "README.md"
keywords = ["zstd", "zstandard", "decompression", "compression", "pure-rust"]
categories = ["compression"]

# docs.rs builds the crate with the public feature set so feature-gated
# items (e.g. the `dictionary` module behind `dict_builder`) appear in the
# published documentation. We list the public features explicitly rather
# than using `all-features = true` because the manifest also exposes
# `rustc-dep-of-std` (libstd-build-only — swaps in `rustc-std-workspace-*`
# crates), `bench_internals` (widens the API surface for benches), and
# `fuzz_exports` (widens it for fuzz targets); none of these should appear
# on docs.rs. The `--cfg docsrs` flag activates the
# `#[cfg_attr(docsrs, doc(cfg(...)))]` annotations that render feature
# badges on each item.
[package.metadata.docs.rs]
features = ["std", "hash", "dict_builder"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
# Locked behind the `hash` feature flag
twox-hash = { version = "2.0", default-features = false, features = ["xxhash64"], optional = true }
fastrand = {version = "2.3.0", optional = true }
# Optional sync primitive for the FSE default-table cache on no-atomic
# targets (Cortex-M0/M0+, AVR, MSP430 — anywhere `target_has_atomic =
# "ptr"` is false). When this feature is enabled the cache uses a
# critical-section-protected `static mut` slot; when disabled the
# no-atomic build skips the cache entirely and returns an owned
# `Box<FSETable>` per call, dropped with the owning `FrameCompressor`
# (no leak — same memory shape as the pre-cache status quo on those
# targets). On targets with atomic pointer support (every modern
# desktop / server / mobile / Cortex-M3+ / RISC-V-A target) the dep
# is dead code and never instantiated — those targets use the lock-
# free `AtomicPtr` path unconditionally.
critical-section = { version = "1.2", optional = true }

# Internal feature, only used when building as part of libstd, not part of the
# stable interface of this crate.
compiler_builtins = { version = "0.1.2", optional = true }
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" }

[dev-dependencies]
criterion = "0.8"
rand = "0.10"
zstd = { version = "0.13.3", features = ["zdict_builder", "experimental"] }

[features]
default = ["hash", "std"]
dict_builder = ["std", "dep:fastrand"]
hash = ["dep:twox-hash"]
# Opt-in cache for FSE default tables on no-atomic targets. See
# `fse_encoder::default_*_table` for the implementation split. On
# targets with atomic pointer support this feature is a no-op.
critical-section = ["dep:critical-section"]
bench_internals = []
fuzz_exports = []
std = []

# Internal feature, only used when building as part of libstd, not part of the
# stable interface of this crate.
rustc-dep-of-std = ["dep:compiler_builtins", "dep:core", "dep:alloc"]

[[bench]]
name = "decode_all"
harness = false

[[bench]]
name = "huf_decode_kernels"
harness = false

[[bench]]
name = "compare_ffi"
harness = false
required-features = ["dict_builder"]

[[bench]]
name = "compare_ffi_memory"
harness = false
required-features = ["dict_builder"]

[[bench]]
name = "compare_ffi_sequences"
harness = false
required-features = ["dict_builder", "bench_internals"]

[[bench]]
name = "bitstream"
harness = false
required-features = ["bench_internals"]

[[bench]]
name = "dict_builder_fastcover"
harness = false
required-features = ["dict_builder"]

[[bench]]
name = "decode_dict_handle"
harness = false

[[bench]]
name = "wildcopy_candidates"
harness = false
required-features = ["bench_internals"]