#actix #codegen #web #macros #proc

macro actix-web-codegen

Actix web proc macros

10 releases

✓ Uses Rust 2018 edition

new 0.2.0 Dec 13, 2019
0.2.0-alpha.2 Dec 2, 2019
0.2.0-alpha.1 Nov 22, 2019
0.1.3 Oct 14, 2019
0.1.0-alpha.1 Mar 28, 2019
Download history 7612/week @ 2019-08-30 8373/week @ 2019-09-06 9183/week @ 2019-09-13 7432/week @ 2019-09-20 8713/week @ 2019-09-27 9132/week @ 2019-10-04 10850/week @ 2019-10-11 13412/week @ 2019-10-18 12340/week @ 2019-10-25 12725/week @ 2019-11-01 12501/week @ 2019-11-08 11712/week @ 2019-11-15 13132/week @ 2019-11-22 11150/week @ 2019-11-29 14058/week @ 2019-12-06

48,262 downloads per month
Used in 108 crates (4 directly)

MIT/Apache

14KB
279 lines

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


lib.rs:

Actix-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 actix_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 actix_web::HttpResponse;
use actix_web_codegen::get;
use futures::{future, Future};

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

Dependencies

~0.5–0.8MB
~20K SLoC