mirror of https://github.com/fafhrd91/actix-web
docs for path attribute
This commit is contained in:
parent
0b61bd6b0b
commit
314ffd71c9
|
@ -117,6 +117,7 @@ Creates route handler with `actix_web::guard::", stringify!($variant), "`.
|
|||
|
||||
# Attributes
|
||||
- `"path"` - Raw literal string with path for which to register handler.
|
||||
- `path="variable_name"` - Variable name that contains 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.
|
||||
|
|
|
@ -77,9 +77,7 @@ impl TryFrom<&syn::LitStr> for MethodType {
|
|||
}
|
||||
|
||||
struct Args {
|
||||
//path: Option<syn::LitStr>,
|
||||
path: Box<dyn PathMarker>,
|
||||
// i_path: Option<syn::Ident>,
|
||||
resource_name: Option<syn::LitStr>,
|
||||
guards: Vec<Ident>,
|
||||
wrappers: Vec<syn::Type>,
|
||||
|
@ -130,11 +128,6 @@ impl Args {
|
|||
}
|
||||
} else if nv.path.is_ident("path") {
|
||||
if let syn::Lit::Str(lit) = nv.lit {
|
||||
// path = Some(syn::LitStr::new(
|
||||
// &Ident::new(&lit.value(), Span::call_site()).to_string(),
|
||||
// Span::call_site(),
|
||||
// ));
|
||||
|
||||
match path {
|
||||
None => {
|
||||
let x = Ident::new(&lit.value(), Span::call_site());
|
||||
|
|
Loading…
Reference in New Issue