#sys #callback #nghttp2

sys libnghttp2-sys

FFI bindings for libnghttp2 (nghttp2)

9 releases

Uses old Rust 2015

0.1.8+1.55.1 Aug 7, 2023
0.1.7+1.45.0 Sep 20, 2021
0.1.6+1.43.0 Feb 2, 2021
0.1.5+1.42.0 Nov 23, 2020
0.1.1 Nov 25, 2018

#206 in HTTP server

Download history 67302/week @ 2023-06-11 67910/week @ 2023-06-18 64553/week @ 2023-06-25 63753/week @ 2023-07-02 72778/week @ 2023-07-09 72547/week @ 2023-07-16 66486/week @ 2023-07-23 61904/week @ 2023-07-30 60208/week @ 2023-08-06 56499/week @ 2023-08-13 63946/week @ 2023-08-20 64442/week @ 2023-08-27 55097/week @ 2023-09-03 61298/week @ 2023-09-10 61849/week @ 2023-09-17 57666/week @ 2023-09-24

240,647 downloads per month
Used in 173 crates (2 directly)

MIT/Apache

4.5MB
113K SLoC

C 53K SLoC // 0.1% comments C++ 49K SLoC // 0.1% comments Go 5.5K SLoC // 0.1% comments Python 2K SLoC // 0.3% comments Rust 1.5K SLoC // 0.0% comments Automake 1.5K SLoC // 0.2% comments Batch 148 SLoC RPM Specfile 59 SLoC Ruby 57 SLoC // 0.1% comments Shell 15 SLoC

nghttp2-sys

A common library for linking nghttp2 to rust programs (also known as libnghttp2).

Generating bindings

Before bindgen:

  • Copy nghttp2ver.h.in to nghttp2ver.h
  • Edit nghttp2ver.h to remove @FOO@, replacing with 0
$ bindgen \
  ./nghttp2/lib/includes/nghttp2/nghttp2.h \
  -o src/lib.rs \
  --no-layout-tests \
  --distrust-clang-mangling \
  --no-prepend-enum-name \
  --rustfmt-bindings \
  --whitelist-function '.*nghttp2.*' \
  --whitelist-type '.*nghttp2.*' \
  --whitelist-var '.*nghttp2.*' \
  -- \
  -I ./nghttp2/lib/includes

Afterwards

  • Remove *vprintf*
  • Remove va_list-related things
  • Add #![allow(bad_style)]

License

This project is licensed under either of

at your option.

Contribution

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

Dependencies