Skip to main content

Module middleware

Module middleware 

Source
Expand description

Named middleware registry. Strings like "auth", "throttle:60,1", "csrf" are resolved at app-init time to tower Layers.

Modules§

builtin
Built-in middleware: installed on the registry during bootstrap.

Structs§

MiddlewareRegistry
MiddlewareSpec
Parsed form of "throttle:60,1"MiddlewareSpec { name: "throttle", args: ["60", "1"] }.
NamedMiddleware
A named middleware: a function that takes a request, optionally consumes args, and returns a response.

Functions§

inject_container_mw
Container injection middleware. Installs the container into the task-local context for the duration of the request so facade functions work.
install_defaults
invoke
Apply a middleware by name to an axum router-style handler chain. The error from MiddlewareFn is converted to a 500 response if not handled.
standard_layers
trace_layer
Convenience for constructing a tracing layer with sensible defaults.

Type Aliases§

MiddlewareFn