#native-bindings #zlib #zlib-ng #api #low-level #mode #libz-ng

sys libz-ng-sys

Low-level bindings to zlib-ng (libz-ng), a high-performance zlib library

11 stable releases

1.1.20 Oct 21, 2024
1.1.16 Aug 24, 2024
1.1.15 Jan 17, 2024
1.1.12 Jul 26, 2023
1.1.8 May 28, 2022

#54 in Compression

Download history 22808/week @ 2024-07-31 24761/week @ 2024-08-07 25102/week @ 2024-08-14 26616/week @ 2024-08-21 24770/week @ 2024-08-28 26183/week @ 2024-09-04 22668/week @ 2024-09-11 28236/week @ 2024-09-18 34772/week @ 2024-09-25 37693/week @ 2024-10-02 35344/week @ 2024-10-09 38280/week @ 2024-10-16 43304/week @ 2024-10-23 39882/week @ 2024-10-30 40004/week @ 2024-11-06 38644/week @ 2024-11-13

168,610 downloads per month
Used in 105 crates (4 directly)

MIT/Apache

485KB
9K SLoC

C 8K SLoC // 0.2% comments Rust 1K SLoC // 0.0% comments

libz-ng-sys

A library for linking zlib-ng (libz-ng) to Rust programs natively, rather than in zlib-compat mode.

zlib-ng is a high-performance implementation of zlib. zlib-ng supports building in two modes: zlib-compat mode, in which it provides the same API as zlib and generally works as a drop-in replacement, and native mode, in which it provides its own API. The native API is almost identical to the zlib-compat API, except that some types use more correct sizes (rather than the sizes required for zlib compatibility), and the functions all have a zng_ prefix. The latter allows zlib and zlib-ng to coexist in the same program.

This crate provides bindings to the native zlib-ng API. However, for simplicity of porting, this crate exports the same API as libz-sys (without the zng_ prefixes), making it easier to write Rust software compatible with both libz-sys and libz-ng-sys.

High-level API

This crate provides bindings to the raw low-level C API. For a higher-level safe API to work with DEFLATE, zlib, or gzip streams, see flate2. flate2 supports many different implementations.

Development

This crate is built from the same sources as libz-sys. From within those sources, Cargo.toml is the manifest for libz-sys, and Cargo-zng.toml is the manifest for libz-ng-sys. The script ./cargo-zng invokes Cargo on a temporary copy of the sources with Cargo-zng.toml replacing Cargo.toml; for instance, use ./cargo-zng publish to publish libz-ng-sys.

Minimum Supported Rust Version (MSRV) Policy

This crate uses the same MSRV policy as the flate2 crate: This crate supports the current and previous stable versions of Rust. Older versions of Rust may work, but we don't guarantee these will continue to work.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies