Skip to main content

Module middleware

Module middleware 

Source
Expand description

Built-in middleware. Each piece is an async function with the signature async fn(Request, Next) -> Result<Response>. Drop any of them into Router::middleware(...) in whatever order you want.

Structs§

CsrfGuard
A value a handler can pull out of the request context to embed in a rendered form. Lightweight; just wraps a string.
RateLimiter

Constants§

CSRF_HEADER

Functions§

csrf_protect
gzip
logger
rate_limit
The middleware function. Wrap a limiter into a closure and hand it to Router::middleware(...).
security_headers