3 unstable releases

0.2.1 Jan 2, 2020
0.2.0 Jan 2, 2020
0.1.0 Jan 2, 2020

#96 in #non-blocking

Download history 18/week @ 2023-07-04 9/week @ 2023-07-11 15/week @ 2023-07-18 17/week @ 2023-07-25 13/week @ 2023-08-01 13/week @ 2023-08-08 17/week @ 2023-08-15 7/week @ 2023-08-22 12/week @ 2023-08-29 16/week @ 2023-09-05 8/week @ 2023-09-12 7/week @ 2023-09-19 18/week @ 2023-09-26 12/week @ 2023-10-03 8/week @ 2023-10-10 15/week @ 2023-10-17

54 downloads per month
Used in 3 crates (via eternal)

MIT license

14KB
278 lines

eternal-macro


lib.rs:

Macro codegen module

Generators for routes and scopes

Route

Macros:

Attributes:

  • "path" - Raw literal string with path for which to register handle. Mandatory.
  • guard="function_name" - Registers function as guard using eternal::web::guard::fn_guard

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 eternal::web::HttpResponse;
use eternal_macro::get;
use futures::{future, Future};

#[get("/test")]
async fn async_test() -> Result<HttpResponse, eternal::web::Error> {
    Ok(HttpResponse::Ok().finish())
}

Dependencies

~1.5MB
~31K SLoC