1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# -----------------------------------------------------------------------------
# HTTP Handle - A fast and lightweight Rust library for handling HTTP requests
# and responses.
# -----------------------------------------------------------------------------
[]
# General project metadata
= "http-handle" # The name of the library
= "0.0.4" # Current version of the crate
= ["HTTP Handle Contributors"] # Library contributors (auto-generated if not defined)
= "2024" # Rust edition
= "1.88.0" # Minimum supported Rust version
= "AGPL-3.0-only" # Project license
= """
A fast and lightweight Rust library for handling HTTP requests and responses.
""" # Short library description
= "https://http-handle.com/" # Project's homepage URL
= "https://http-handle.com/documentation/index.html" # Documentation URL
= "https://github.com/sebastienrousseau/http-handle" # Repository URL
= "README.md" # Path to the README file
= "build.rs" # Path to the build script (optional if used)
# -----------------------------------------------------------------------------
# Dependencies
# -----------------------------------------------------------------------------
[]
# Required dependencies for building and running the project.
= "2.0" # Error handling library for defining custom errors
= { = "1.0", = ["derive"] } # Serialization/deserialization with derive features
= "1.0" # JSON support with Serde
= "0.4" # Logging facade for Rust
= { = "0.11", = true } # Optional logging with environment variable support
= { = "0.0.2", = false, = ["error", "logging", "time"] }
= "3.4" # Signal handling for graceful shutdown
= "1.11" # Runtime custom language pattern support
= { = "1.44", = true, = false, = ["rt", "sync", "time", "macros", "net", "fs", "io-util"] } # Async runtime support
= { = "0.1", = true } # Structured logging
= { = "0.3", = true, = ["fmt", "env-filter"] } # Tracing subscriber
= { = "0.4", = true } # HTTP/2 protocol support
= { = "1.3", = true } # HTTP type definitions for h2
= { = "1.10", = true } # Zero-copy byte buffers for h2 body frames
= { = "0.2", = true } # Unix sendfile support
= { = "8.2", = true } # Config hot-reload file watcher
= { = "1.7", = true } # Lock-free hot config swaps
= { = "1.0", = true } # Profile config loading
# -----------------------------------------------------------------------------
# Library Configuration
# -----------------------------------------------------------------------------
[]
# Library-specific configurations.
= "http_handle" # Name of the library
= "src/lib.rs" # Path to the library’s main file
# -----------------------------------------------------------------------------
# Build Dependencies
# -----------------------------------------------------------------------------
[]
# Dependencies for the build script, used for pre-compilation tasks.
= "0.9" # Ensures that a compatible Rust version is used
# -----------------------------------------------------------------------------
# Development Dependencies
# -----------------------------------------------------------------------------
[]
# Dependencies required for testing and development.
= "3.13" # Temporary file creation for tests
= "1.1" # File system assertion library for tests
= "3.1" # Predicate assertions for test conditions
= "0.8" # Benchmarking library to test performance
= "1.6" # Property-based testing
# -----------------------------------------------------------------------------
# Examples
# -----------------------------------------------------------------------------
[[]]
# Example code demonstrating the library in use.
= "basic_server" # Name of the example
= "examples/basic_server.rs" # Path to the example file
[[]]
# Example code demonstrating error handling.
= "error_example" # Name of the example
= "examples/error_example.rs" # Path to the example file
[[]]
# Example code demonstrating the library as a library.
= "full_demo" # Name of the example
= "examples/full_demo.rs" # Path to the example file
[[]]
# Legacy library example preserved from earlier revisions.
= "lib_example_legacy" # Name of the example
= "examples/lib_example_legacy.rs" # Path to the example file
[[]]
# Example code demonstrating request handling.
= "request_example" # Name of the example
= "examples/request_example.rs" # Path to the example file
[[]]
# Example code demonstrating response handling.
= "response_example" # Name of the example
= "examples/response_example.rs" # Path to the example file
[[]]
# Example code demonstrating server handling.
= "server_example" # Name of the example
= "examples/server_example.rs" # Path to the example file
[[]]
# Example code demonstrating graceful shutdown.
= "graceful_shutdown_example" # Name of the example
= "examples/graceful_shutdown_example.rs" # Path to the example file
[[]]
# Example code demonstrating ServerBuilder pattern usage.
= "server_builder_example" # Name of the example
= "examples/server_builder_example.rs" # Path to the example file
[[]]
# Example code demonstrating language detection with custom patterns.
= "feature_language_detection" # Name of the example
= "examples/feature_language_detection.rs" # Path to the example file
[[]]
# Example code demonstrating concurrent batch processing.
= "feature_batch_processing" # Name of the example
= "examples/feature_batch_processing.rs" # Path to the example file
= ["batch"] # Only build when batch is enabled
[[]]
# Example code demonstrating chunked file streaming.
= "feature_streaming_chunks" # Name of the example
= "examples/feature_streaming_chunks.rs" # Path to the example file
= ["streaming"] # Only build when streaming is enabled
[[]]
# Example code demonstrating optimized lookup helpers.
= "feature_optimized_lookups" # Name of the example
= "examples/feature_optimized_lookups.rs" # Path to the example file
= ["optimized"] # Only build when optimized is enabled
[[]]
# Example code demonstrating observability initialization.
= "feature_observability" # Name of the example
= "examples/feature_observability.rs" # Path to the example file
= ["observability"] # Only build when observability is enabled
[[]]
# Example code demonstrating async runtime helper.
= "feature_async_runtime" # Name of the example
= "examples/feature_async_runtime.rs" # Path to the example file
= ["async"] # Only build when async is enabled
[[]]
# Example code demonstrating async server startup.
= "feature_async_server" # Name of the example
= "examples/feature_async_server.rs" # Path to the example file
= ["async"] # Only build when async is enabled
[[]]
# Example code demonstrating HTTP/2 server startup.
= "feature_http2_server" # Name of the example
= "examples/feature_http2_server.rs" # Path to the example file
= ["http2"] # Only build when HTTP/2 is enabled
[[]]
# Example code demonstrating HTTP/3 ALPN profile and fallback policy.
= "feature_http3_profile" # Name of the example
= "examples/feature_http3_profile.rs" # Path to the example file
= ["http3-profile"] # Only build when HTTP/3 profile is enabled
[[]]
# Example code demonstrating distributed rate limiting adapters.
= "feature_distributed_rate_limit" # Name of the example
= "examples/feature_distributed_rate_limit.rs" # Path to the example file
= ["distributed-rate-limit"] # Only build when distributed rate limiting is enabled
[[]]
# Example code demonstrating tenant isolation and secret providers.
= "feature_tenant_isolation" # Name of the example
= "examples/feature_tenant_isolation.rs" # Path to the example file
= ["multi-tenant"] # Only build when multi-tenant isolation is enabled
[[]]
# Example code demonstrating runtime auto-tuning.
= "feature_runtime_autotune" # Name of the example
= "examples/feature_runtime_autotune.rs" # Path to the example file
= ["autotune"] # Only build when autotune is enabled
[[]]
# Example code demonstrating enterprise authorization policies.
= "feature_enterprise_authorization" # Name of the example
= "examples/feature_enterprise_authorization.rs" # Path to the example file
= ["enterprise"] # Only build when enterprise is enabled
[[]]
# Example code demonstrating practical server policy configuration.
= "scenario_server_policies" # Name of the example
= "examples/scenario_server_policies.rs" # Path to the example file
[[]]
# Benchmark target binary for external load tools.
= "benchmark_target" # Name of the example
= "examples/benchmark_target.rs" # Path to the example file
# -----------------------------------------------------------------------------
# Criterion Benchmark
# -----------------------------------------------------------------------------
[[]]
# Benchmarking configuration for performance testing.
= "server_benchmark" # Name of the benchmark
= false # Disable the default benchmark harness (used by Criterion)
[]
# Profile used when running benchmarks.
= true # Include debug symbols for better diagnostics
# -----------------------------------------------------------------------------
# Features
# -----------------------------------------------------------------------------
[]
# Optional features that can be enabled or disabled.
= [] # No default features enabled
= ["dep:tokio"] # Async runtime and hardened blocking helper
= [] # Concurrent batch processing APIs
= [] # Chunked streaming APIs
= [] # Zero-cost optimized lookups
= ["dep:tracing", "dep:tracing-subscriber"] # Structured tracing/observability
= ["dep:tokio", "dep:h2", "dep:http", "dep:bytes"] # HTTP/2 server foundation (h2c)
= ["dep:tokio", "dep:libc"] # Async-first serving with backpressure and sendfile fast path
= [] # TLS and mTLS configuration primitives
= [] # Auth middleware (API key + JWT parsing hook)
= ["dep:notify", "dep:arc-swap", "dep:toml"] # Runtime profiles + hot reload
= ["tls", "auth", "config", "observability"] # Enterprise-ready integrations
= [] # HTTP/3 production profile and ALPN fallback helpers
= [] # Distributed rate-limit backends and adapters
= [] # Tenant-isolated config and secret providers
= ["high-perf"] # Runtime auto-tuning for host resource profiles
# -----------------------------------------------------------------------------
# Documentation Configuration
# -----------------------------------------------------------------------------
[]
# Settings for building and hosting documentation on docs.rs.
= true # Build documentation with all features enabled
= ["--cfg", "docsrs"] # Arguments passed to `rustdoc` when building the documentation
= ["x86_64-apple-darwin", "x86_64-unknown-linux-gnu"] # Publish docs metadata for macOS + Linux
# -----------------------------------------------------------------------------
# Linting Configuration
# -----------------------------------------------------------------------------
[]
# Linting rules for the project.
## Warnings
= "warn" # Warn if types can implement `Copy` but don’t
= "deny" # Deny if public items lack documentation
= "warn" # Warn on the usage of unstable features
= "warn" # Warn about unused external crates
= "warn" # Warn if a result type is unused (e.g., errors ignored)
## Allowances
= "allow" # Allow bare trait objects (e.g., `Box<dyn Trait>`)
= "allow" # Allow lifetimes to be elided in paths
= "allow" # Allow non-camel-case types
= "allow" # Allow non-uppercase global variables
= "allow" # Allow trivial bounds in trait definitions
= "allow" # Allow the usage of unsafe code blocks
## Forbidden
= "forbid" # Forbid missing `Debug` implementations
= "forbid" # Forbid non-ASCII identifiers
= "forbid" # Forbid unreachable `pub` items
## Denials
= "deny" # Deny unused, dead code in the project
= "deny" # Deny code that will be deprecated in the future
= "deny" # Deny usage of inclusive ranges in match patterns (`...`)
= "deny" # Deny unnecessary lifetime outlives requirements
= { = "deny", = -1 } # Handle future compatibility issues
= { = "deny", = -1 } # Deny usage of keywords as identifiers
= "deny" # Deny macro use of `extern crate`
= "deny" # Deny misuse of meta variables in macros
= "deny" # Deny method calls that have no effect
= { = "deny", = -1 } # Enforce Rust 2018 idioms
= { = "deny", = -1 } # Enforce Rust 2021 compatibility
= { = "deny", = -1 } # Enforce Rust 2024 compatibility
= "deny" # Deny lifetimes that are used only once
= "deny" # Deny trivial casts (e.g., `as` when unnecessary)
= "deny" # Deny trivial numeric casts (e.g., `i32` to `i64`)
= { = "deny", = -1 } # Deny unused code, variables, etc.
= "deny" # Deny unused features
= "deny" # Deny unnecessary braces around imports
= "deny" # Deny unused labels in loops
= "deny" # Deny unused lifetimes
= "deny" # Deny unused macros
= "deny" # Deny unnecessary type qualifications
= "deny" # Deny enum variants with significant size differences
# -----------------------------------------------------------------------------
# Clippy Configuration
# -----------------------------------------------------------------------------
[]
# Clippy lint configuration for enhanced code analysis.
= [
"clippy::all", # Warn on all common Clippy lints
"clippy::pedantic", # Enable pedantic lints for stricter checking
"clippy::cargo", # Enable lints specific to cargo
"clippy::nursery", # Enable lints from Clippy’s nursery (experimental)
]
# -----------------------------------------------------------------------------
# Profiles
# -----------------------------------------------------------------------------
[]
# Development profile configuration for fast builds and debugging.
= 256 # Increase codegen units for faster compilation
= true # Enable debugging symbols
= true # Enable debug assertions
= true # Enable incremental compilation
= false # Disable link-time optimization for development
= 0 # No optimizations in development
= true # Enable overflow checks for arithmetic operations
= 'unwind' # Enable unwinding for panics (useful in development)
= false # Disable rpath generation
= false # Do not strip symbols in development builds
[]
# Release profile configuration for optimized builds.
= 1 # Reduce codegen units for better performance
= false # Disable debug symbols in release builds
= false # Disable debug assertions
= false # Disable incremental compilation for optimal binary size
= true # Enable link-time optimization for smaller and faster binaries
= "s" # Optimize for binary size
= false # Disable overflow checks for performance
= "abort" # Use abort on panic for minimal overhead
= false # Disable rpath generation
= "symbols" # Strip symbols for smaller binary size
[]
# Test profile configuration for debugging and development.
= 256 # Increase codegen units for faster test builds
= true # Enable debugging symbols for test builds
= true # Enable debug assertions for tests
= true # Enable incremental compilation for tests
= false # Disable link-time optimization during testing
= 0 # No optimizations in test builds
= true # Enable overflow checks for tests
= false # Disable rpath generation
= false # Do not strip symbols in test builds