#zstd #api-bindings #zstandard

sys no-std zstd-sys

Low-level bindings for the zstd compression library

44 stable releases

2.0.14+zstd.1.5.7 Feb 20, 2025
2.0.13+zstd.1.5.6 Aug 2, 2024
2.0.12+zstd.1.5.6 Jul 5, 2024
2.0.10+zstd.1.5.6 Mar 27, 2024
1.1.5-a Mar 24, 2017

#175 in Compression

Download history 1021096/week @ 2024-11-01 1066955/week @ 2024-11-08 1091658/week @ 2024-11-15 944691/week @ 2024-11-22 995300/week @ 2024-11-29 1130300/week @ 2024-12-06 1059245/week @ 2024-12-13 588481/week @ 2024-12-20 549893/week @ 2024-12-27 1015739/week @ 2025-01-03 1197646/week @ 2025-01-10 1081609/week @ 2025-01-17 1145162/week @ 2025-01-24 1220671/week @ 2025-01-31 1372795/week @ 2025-02-07 599980/week @ 2025-02-14

4,546,436 downloads per month
Used in 3,949 crates (29 directly)

MIT/Apache

2.5MB
46K SLoC

C 41K SLoC // 0.2% comments Rust 4.5K SLoC // 0.1% comments GNU Style Assembly 390 SLoC // 0.2% comments

zstd-sys

This is the low-level auto-generated binding to the zstd library. You probably don't want to use this library directly; instead, look at zstd-rs or zstd-safe.

Compile it yourself

zstd is included as a submodule. To get everything during your clone, use:

git clone https://github.com/gyscos/zstd-rs --recursive

Or, if you cloned it without the --recursive flag, call this from inside the repository:

git submodule update --init

Then, running cargo build in this directory should take care of building the C library and linking to it.

Build-time bindgen

This library includes a pre-generated bindings.rs file. You can also generate new bindings at build-time, using the bindgen feature:

cargo build --features bindgen

lib.rs:

Low-level bindings to the zstd library.

Dependencies