7 releases (1 stable)
Uses new Rust 2024
| 3.0.0 | Jan 2, 2026 |
|---|---|
| 0.2.0 | Nov 26, 2025 |
| 0.1.4 | Mar 14, 2025 |
| 0.1.3 | Feb 24, 2021 |
| 0.1.0 | Apr 10, 2020 |
#1722 in Procedural macros
13,142 downloads per month
Used in 76 crates
(2 directly)
19KB
403 lines
ntex macros module
Generators for routes
Route
Macros:
Attributes:
"path"- Raw literal string with path for which to register handle. Mandatory.guard = "function_name"- Registers function as guard usingntex::web::guard::fn_guarderror = "ErrorRenderer"- Register handler for specified error renderer
Notes
Function name can be specified as any expression that is going to be accessible to the generate
code (e.g my_guard or my_module::my_guard)
Example:
use ntex::web::{get, Error, HttpResponse};
use futures::{future, Future};
#[get("/test")]
async fn async_test() -> Result<HttpResponse, Error> {
Ok(HttpResponse::Ok().finish())
}
Macros for ntex::web framework 
Dependencies
~1.5MB
~40K SLoC