Skip to main content

Module router

Module router 

Source
Available on crate feature router only.
Expand description

Declarative router with per-route auth and CSRF configuration.

Build a Vec<Router> and pass it to build_router; the returned closure is configured on a scope (scope("/api").configure(build_router(...))). Each route runs the Checker auth guard first, then CSRF (feature csrf).

Structs§

Router
A route entry for build_router.

Enums§

CSRFTypecsrf
Per-route CSRF enforcement level (see crate::csrf).

Traits§

Checker
Per-route permission checker.

Functions§

build_routercsrf
Configure routes on a scope, wrapping each route with the CSRF middleware (innermost) and the auth guard.