Expand description
Handler trait and its implementations for async functions of various arities.
This module provides the Handler trait, which is implemented automatically for
async fns with 0 to 16 extractors. The macro-generated impls are repetitive by
necessity – Rust has no variadic generics yet – but are confined here to keep
routing/mod.rs focused on routing logic.
Structs§
- Async
Handler - Marker for asynchronous handlers.
- Sync
Handler - Marker for synchronous handlers.
Enums§
- Response
Future - A future that might be immediately ready, avoiding heap allocation.
Traits§
- Handler
- Trait for types that can handle an HTTP request.
Type Aliases§
- Boxed
Future - A pinned, boxed,
Sendfuture returning an HTTP response, or an immediately resolved response. - Boxed
Handler - A type-erased handler:
Arc<dyn Fn(Request<Body>, Arc<S>) -> BoxedFuture>.