#zstd-compression #zstd #api-bindings

no-std zstd-safe

Safe low-level bindings for the zstd compression library

53 stable releases (6 major)

7.2.4 Mar 20, 2025
7.2.1 Aug 2, 2024
7.2.0 Jul 5, 2024
7.1.0 Mar 27, 2024
1.3.1 Jul 5, 2017

#414 in Compression

Download history 1594761/week @ 2024-12-08 1233203/week @ 2024-12-15 583600/week @ 2024-12-22 733031/week @ 2024-12-29 1314404/week @ 2025-01-05 1419325/week @ 2025-01-12 1279778/week @ 2025-01-19 1355316/week @ 2025-01-26 1496879/week @ 2025-02-02 1779763/week @ 2025-02-09 1704713/week @ 2025-02-16 2028256/week @ 2025-02-23 2061763/week @ 2025-03-02 2088340/week @ 2025-03-09 2030691/week @ 2025-03-16 1898028/week @ 2025-03-23

8,215,895 downloads per month
Used in 4,055 crates (23 directly)

MIT/Apache

2.5MB
47K SLoC

C 40K SLoC // 0.2% comments Rust 7K SLoC // 0.1% comments GNU Style Assembly 379 SLoC // 0.2% comments

zstd-safe

This is a thin, no-std, safe abstraction built on top of the bindings from [zstd-sys].

It is close to a 1-for-1 mapping to the C functions, but uses rust types like slices instead of pointers and lengths.

For a more comfortable higher-level library (with Read/Write implementations), see zstd-rs.


lib.rs:

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.

Dependencies