Skip to content

Commit ed9528d

Browse files
committed
docs: document crate features for "ngx"
1 parent 1c8a27a commit ed9528d

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,24 @@ pin-project-lite = { version = "0.2.16", optional = true }
4545

4646
[features]
4747
default = ["std"]
48+
# Enables a minimal async runtime built on top of the NGINX event loop.
4849
async = [
4950
"alloc",
5051
"dep:async-task",
5152
"dep:pin-project-lite",
5253
]
53-
# Enables the components using memory allocation.
54-
# If no `std` flag, `alloc` crate is internally used instead. This flag is mainly for `no_std` build.
54+
# Provides APIs that require allocations via the `alloc` crate.
5555
alloc = ["allocator-api2/alloc"]
56-
# Enables serde support for some of the provided types.
56+
# Enables serialization support for some of the provided and re-exported types.
5757
serde = [
5858
"allocator-api2/serde",
5959
]
60-
# Enables the components using `std` crate.
60+
# Provides APIs that require the standard library.
6161
std = [
6262
"alloc",
6363
"allocator-api2/std"
6464
]
65-
# Build our own copy of the NGINX from `nginx-src` crate.
65+
# Enables the build scripts to build a copy of nginx source and link against it.
6666
vendored = ["nginx-sys/vendored"]
6767

6868
[badges]

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ By default, this will use the latest stable release of NGINX and require
6060
system-wide installation of build dependencies (OpenSSL, PCRE2, Zlib).
6161

6262
The behavior of vendored builds can be customized with environment variables,
63-
as documented in the [nginx-src](./nginx-src/) crate README.
63+
as documented in the [nginx-src] crate README.
6464

6565
**NOTE**: We recommend to build the module binaries against the exact source and
6666
configuration of the NGINX build that you are planning to use in production,
@@ -70,7 +70,21 @@ and that is unlikely to be possible with the vendored source.
7070
and some OS distributions are known to ship nginx packages with API-breaking
7171
patches applied.
7272

73-
### Dependencies
73+
[nginx-src]: https://docs.rs/nginx-src/
74+
75+
## Cargo features
76+
77+
- `alloc` - **Enabled** by default. This provides APIs that require allocations
78+
via the `alloc` crate.
79+
- `async` - Enables a minimal async runtime built on top of the NGINX event loop.
80+
- `serde` - Enables serialization support for some of the provided and
81+
re-exported types.
82+
- `std` - **Enabled** by default. This provides APIs that require the standard
83+
library.
84+
- `vendored`: Enables the build scripts to build a copy of nginx source and link
85+
against it. See the [nginx-src] crate documentation for additional details.
86+
87+
## Dependencies
7488

7589
The following dependencies are required to build a Rust NGINX module on Linux
7690
or BSD platform:

src/lib.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
//! system-wide installation of build dependencies (OpenSSL, PCRE2, Zlib).
5454
//!
5555
//! The behavior of vendored builds can be customized with environment variables,
56-
//! as documented in the [nginx-src](./nginx-src/) crate README.
56+
//! as documented in the [nginx-src] crate README.
5757
//!
5858
//! **NOTE**: We recommend to build the module binaries against the exact source and
5959
//! configuration of the NGINX build that you are planning to use in production,
@@ -63,7 +63,21 @@
6363
//! and some OS distributions are known to ship nginx packages with API-breaking
6464
//! patches applied.
6565
//!
66-
//! ### Dependencies
66+
//! [nginx-src]: https://docs.rs/nginx-src/
67+
//!
68+
//! ## Cargo features
69+
//!
70+
//! - `alloc` - **Enabled** by default. This provides APIs that require allocations
71+
//! via the `alloc` crate.
72+
//! - `async` - Enables a minimal async runtime built on top of the NGINX event loop.
73+
//! - `serde` - Enables serialization support for some of the provided and
74+
//! re-exported types.
75+
//! - `std` - **Enabled** by default. This provides APIs that require the standard
76+
//! library.
77+
//! - `vendored`: Enables the build scripts to build a copy of nginx source and link
78+
//! against it. See the [nginx-src] crate documentation for additional details.
79+
//!
80+
//! ## Dependencies
6781
//!
6882
//! The following dependencies are required to build a Rust NGINX module on Linux
6983
//! or BSD platform:

0 commit comments

Comments
 (0)