1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-01 01:16:59 +02:00

Add "name" attribute to route macro (#1934)

This commit is contained in:
Richard Chien
2021-03-04 20:38:47 +08:00
committed by GitHub
parent 14b249b804
commit fc6f974617
4 changed files with 33 additions and 2 deletions

View File

@@ -71,6 +71,7 @@ mod route;
///
/// # Attributes
/// - `"path"` - Raw literal string with path for which to register handler.
/// - `name="resource_name"` - Specifies resource name for the handler. If not set, the function name of handler is used.
/// - `method="HTTP_METHOD"` - Registers HTTP method to provide guard for. Upper-case string, "GET", "POST" for example.
/// - `guard="function_name"` - Registers function as guard using `actix_web::guard::fn_guard`
/// - `wrap="Middleware"` - Registers a resource middleware.
@@ -116,6 +117,7 @@ Creates route handler with `actix_web::guard::", stringify!($variant), "`.
# Attributes
- `"path"` - Raw literal string with path for which to register handler.
- `name="resource_name"` - Specifies resource name for the handler. If not set, the function name of handler is used.
- `guard="function_name"` - Registers function as guard using `actix_web::guard::fn_guard`.
- `wrap="Middleware"` - Registers a resource middleware.