sys no-std zstd-sys

Low-level bindings for the zstd compression library

46 stable releases

2.0.16+zstd.1.5.7 Sep 4, 2025
2.0.15+zstd.1.5.7 Mar 20, 2025
2.0.14+zstd.1.5.7 Feb 20, 2025
2.0.13+zstd.1.5.6 Aug 2, 2024
1.1.5-a Mar 24, 2017

#287 in Compression

Download history 2078711/week @ 2025-09-03 2102812/week @ 2025-09-10 2115828/week @ 2025-09-17 2136666/week @ 2025-09-24 2105933/week @ 2025-10-01 2101416/week @ 2025-10-08 2110082/week @ 2025-10-15 2197486/week @ 2025-10-22 2266487/week @ 2025-10-29 2299128/week @ 2025-11-05 2306238/week @ 2025-11-12 2514677/week @ 2025-11-19 1986560/week @ 2025-11-26 2395382/week @ 2025-12-03 2077733/week @ 2025-12-10

6,878,130 downloads per month
Used in 6,441 crates (40 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

Low-level bindings to the zstd library.


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

Dependencies

~0–2.1MB
~42K SLoC