#nginx #module #bindings #api-bindings #abstraction #lifetime #build

nginx_module

Rust bindings for building Nginx modules

5 releases

0.1.4 Dec 11, 2023
0.1.3 Dec 11, 2023
0.1.2 Dec 11, 2023
0.1.1 Nov 17, 2023
0.1.0 Nov 17, 2023

#15 in #nginx

Download history 103/week @ 2024-01-05 196/week @ 2024-01-12 60/week @ 2024-01-19 71/week @ 2024-01-26 65/week @ 2024-02-02 38/week @ 2024-02-09 157/week @ 2024-02-16 58/week @ 2024-02-23 42/week @ 2024-03-01 32/week @ 2024-03-08 29/week @ 2024-03-15 15/week @ 2024-03-22 27/week @ 2024-03-29 5/week @ 2024-04-05 16/week @ 2024-04-12 7/week @ 2024-04-19

56 downloads per month

Apache-2.0

46KB
1K SLoC

Description

This repository contains Rust bindings to Nginx, allowing you to create Nginx modules using the Rust language.

Goals

  • Safety - This repository aims to provide safe abstractions on top of Nginx API. In particular, it aims to provide appropriate lifetimes to abstractions to leverage Rust borrow checker.
  • Ease of use - Abstactions are provided to hide Nginx API complexity.

Build

Prerequisites

  • Rust: Install with rustup: https://rustup.rs/
  • Nginx repository: This project needs the Nginx headers to generate the required Rust bindings to Nginx. At build time the nginx_module crate looks for the nginx folder starting with this module's folder and going upwards up to 4 levels so you can easily have an nginx folder side by side or use this as a submodule for nginx.

Building a module

Please look at the simple example for more details on how to build this.

Dependencies

~0.2–2MB
~41K SLoC