[−][src]Crate actix_web_cute_codegen
Actix-web codegen module
Generators for routes and scopes
Route
Macros:
Attributes:
"path"
- Raw literal string with path for which to register handle. Mandatory.async
- Attribute to indicate that registered function is asynchronous.guard="function_name"
- Registers function as guard usingactix_web::guard::fn_guard
Scope
Macros:
Attributes:
"path"
- Raw literal string with path for which to register handle. Mandatory.guard="function_name"
- Registers function as guard usingactix_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_cute_codegen::get; use futures::{future, Future}; #[get("/test", async)] fn async_test() -> impl Future<Item=HttpResponse, Error=actix_web::Error> { future::ok(HttpResponse::Ok().finish()) }
Attribute Macros
delete | Creates route handler with |
get | Creates route handler with |
guard | Marks function as guard |
handler | Creates route handler without attached method guard. |
hook | Marks function as hook. |
post | Creates route handler with |
put | Creates route handler with |
scope | Generates scope |
Derive Macros
Scope | Generates Application |