#actix #codegen #web #macros #chat #proc

macro actix-web-codegen

Actix web proc macros

6 releases

✓ Uses Rust 2018 edition

0.1.2 Jun 4, 2019
0.1.1 Jun 1, 2019
0.1.0 May 18, 2019
0.1.0-beta.1 Apr 21, 2019
0.1.0-alpha.1 Mar 28, 2019
Download history 466/week @ 2019-03-26 531/week @ 2019-04-02 946/week @ 2019-04-09 1355/week @ 2019-04-16 1320/week @ 2019-04-23 1344/week @ 2019-04-30 1567/week @ 2019-05-07 2219/week @ 2019-05-14 2543/week @ 2019-05-21 2409/week @ 2019-05-28

5,775 downloads per month
Used in 35 crates (1 directly)

MIT/Apache

13KB
230 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")]
fn async_test() -> impl Future<Item=HttpResponse, Error=actix_web::Error> {
    future::ok(HttpResponse::Ok().finish())
}

Dependencies

~764KB
~17K SLoC