Skip to main content

Module handler

Module handler 

Source
Expand description

The handler abstraction: extract parameters, produce a response, and combine them.

This module defines how a handler receives a Bundle (via FromRequest), produces a response (via IntoResponse), and how responses are combined across the handler chain (Call). It also provides the three handler wrappers: tower_handler::TowerHandler, async_handler::AsyncHandler, and sync_handler::SyncHandler.

Modules§

async_handler
A type-erased asynchronous handler.
sync_handler
A type-erased synchronous handler.
tower_handler
A handler wrapper that integrates with the tower ecosystem.

Structs§

Bundle
The container passed through the handler chain, carrying the request, response, state, and a stop flag.
State
The type-erased state carried through the handler chain.
StopFlag
A flag that stops the handler chain.

Traits§

Call
A type-erased handler callable with a whole bundle.
FromRequest
Define how A value be extracted from a Bundle.
Handler
A handler that takes extracted parameters and returns a future yielding a response.
IntoResponse
A value that can be converted into a response.