#zstd #safe-bindings #zstandard #api-bindings #read-write

no-std zstd-safe

Safe low-level bindings for the zstd compression library

48 stable releases (6 major)

7.1.0 Mar 27, 2024
7.0.0 Oct 11, 2023
6.0.6 Jul 19, 2023
6.0.4+zstd.1.5.4 Feb 10, 2023
1.3.1 Jul 5, 2017

#110 in Compression

Download history 812903/week @ 2024-01-25 829751/week @ 2024-02-01 847896/week @ 2024-02-08 840335/week @ 2024-02-15 926708/week @ 2024-02-22 959071/week @ 2024-02-29 921959/week @ 2024-03-07 936597/week @ 2024-03-14 928551/week @ 2024-03-21 969200/week @ 2024-03-28 996712/week @ 2024-04-04 996508/week @ 2024-04-11 1003894/week @ 2024-04-18 988825/week @ 2024-04-25 1005015/week @ 2024-05-02 854620/week @ 2024-05-09

4,032,764 downloads per month
Used in 2,651 crates (21 directly)

MIT/Apache

2.5MB
45K SLoC

C 39K SLoC // 0.2% comments Rust 6K SLoC // 0.1% comments GNU Style Assembly 374 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