#safe-bindings #zstd #zstandard #safe-abstraction #api-bindings

no-std zstd-safe

Safe low-level bindings for the zstd compression library

52 stable releases (6 major)

7.2.3 Feb 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

#282 in Compression

Download history 1205782/week @ 2024-11-21 1131351/week @ 2024-11-28 1485159/week @ 2024-12-05 1379889/week @ 2024-12-12 815249/week @ 2024-12-19 581683/week @ 2024-12-26 1126732/week @ 2025-01-02 1428110/week @ 2025-01-09 1298907/week @ 2025-01-16 1354868/week @ 2025-01-23 1405233/week @ 2025-01-30 1646357/week @ 2025-02-06 1683534/week @ 2025-02-13 1969734/week @ 2025-02-20 2060170/week @ 2025-02-27 1691617/week @ 2025-03-06

7,761,563 downloads per month
Used in 3,952 crates (22 directly)

MIT/Apache

2.5MB
47K SLoC

C 40K SLoC // 0.2% comments Rust 6.5K 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