actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

add parameter for guard object for router attribute macros

Open anatawa12 opened this issue 4 years ago • 1 comments

Currently, guard parameter accepts guard function, not a guard object. I want to use guard object like Header("", "") in router attribute. So, I request adding a parameter for guard_obj for router attribute macros.

anatawa12 avatar May 21 '21 05:05 anatawa12

agree, this is useful, it can be obj_guard(like fn_guard) solved, obj_guard's value like guard::Get(), guard::Host(...),... and maybe guard in macro attribue should rename to guard_fn?,such as #[route("/multi", guard_fn="xxx"]

Silentdoer avatar Jan 15 '22 01:01 Silentdoer