Skip to main content

Module handler

Module handler 

Source
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§

AsyncHandler
Marker for asynchronous handlers.
SyncHandler
Marker for synchronous handlers.

Enums§

ResponseFuture
A future that might be immediately ready, avoiding heap allocation.

Traits§

Handler
Trait for types that can handle an HTTP request.

Type Aliases§

BoxedFuture
A pinned, boxed, Send future returning an HTTP response, or an immediately resolved response.
BoxedHandler
A type-erased handler: Arc<dyn Fn(Request<Body>, Arc<S>) -> BoxedFuture>.