4 releases
0.1.3 | Feb 24, 2021 |
---|---|
0.1.2 | Feb 24, 2021 |
0.1.1 | Feb 24, 2021 |
0.1.0 | Apr 10, 2020 |
#18 in #ntex
9,890 downloads per month
Used in 50 crates
(4 directly)
17KB
350 lines
Macros for ntex::web framework
lib.rs
:
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_guard
error = "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())
}
Dependencies
~1.5MB
~37K SLoC