1 unstable release

0.2.0 Jan 20, 2020

#5 in #actori-web

Download history 8/week @ 2024-01-04 18/week @ 2024-01-11 8/week @ 2024-01-18 4/week @ 2024-01-25 2/week @ 2024-02-01 13/week @ 2024-02-08 31/week @ 2024-02-15 45/week @ 2024-02-22 27/week @ 2024-02-29 32/week @ 2024-03-07 27/week @ 2024-03-14 36/week @ 2024-03-21 71/week @ 2024-03-28 28/week @ 2024-04-04 34/week @ 2024-04-11 19/week @ 2024-04-18

152 downloads per month
Used in 11 crates (via actori-web)

MIT/Apache

15KB
278 lines

Macros for actori-web framework Build Status codecov crates.io Join the chat at https://gitter.im/actori/actori


lib.rs:

Actori-web 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 actori_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 actori_web::HttpResponse;
use actori_web_codegen::get;
use futures::{future, Future};

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

Dependencies

~1.5MB
~33K SLoC