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

#20 in #ntex

Download history 881/week @ 2024-02-05 677/week @ 2024-02-12 901/week @ 2024-02-19 1041/week @ 2024-02-26 1211/week @ 2024-03-04 1384/week @ 2024-03-11 1469/week @ 2024-03-18 1249/week @ 2024-03-25 1260/week @ 2024-04-01 1295/week @ 2024-04-08 1481/week @ 2024-04-15 1640/week @ 2024-04-22 1507/week @ 2024-04-29 1652/week @ 2024-05-06 1092/week @ 2024-05-13 1120/week @ 2024-05-20

5,479 downloads per month
Used in 46 crates (3 directly)

MIT license

17KB
350 lines

Macros for ntex::web framework Build Status


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 using ntex::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
~34K SLoC