Expand description
Framework-agnostic HTTP foundation: request, response, routing, middleware, kernel.
Modules§
Structs§
- AsyncFn
- Function-style async controller.
- Async
Health Middleware - Async variant of
HealthMiddleware. - Async
Http Kernel - Runs async middleware, then the controller, and maps errors to responses.
- Async
Next - Remainder of the async middleware / controller stack.
- Async
Request IdMiddleware - Async variant of
RequestIdMiddleware. - Attribute
Bag - Heterogeneous map keyed by string. Values must be
Send + Sync. - Default
Exception Handler - Maps
HttpError::status_codeandHttpError::messageto a text response. - Headers
- Header names stored in lowercase; lookup is case-insensitive.
- Health
Middleware - Short-circuits
HEALTHZ_PATH/READYZ_PATHbefore the rest of the pipeline. - Http
Cache Headers - Cache-related headers to apply on a
Response. - Http
Kernel - Runs middleware, then the controller, and maps errors to responses.
- Match
Result - Successful match: route name plus path parameters.
- Readiness
- Shared readiness bit flipped false before HTTP drain / process exit.
- Request
- Framework-agnostic HTTP request.
- Request
IdMiddleware - Ensures a request id exists on the request (header + attribute) and echoes it on the response.
- Response
- Framework-agnostic HTTP response.
- Route
- A single route: name, path pattern, and allowed methods.
- Route
Collection - Ordered list of routes. First match wins.
- Sync
ToAsync - Wraps a sync
RequestHandlerfor use withcrate::AsyncHttpKernel. - UrlMatcher
- Matches request method and path against a
RouteCollection.
Enums§
- Http
Error - Failure while handling a request.
- Method
- HTTP method on
crate::Request.
Constants§
- HEALTHZ_
PATH - Default liveness probe path.
- READYZ_
PATH - Default readiness probe path.
- REQUEST_
ID_ ATTRIBUTE - Request attribute key storing the resolved request id (
String). - REQUEST_
ID_ HEADER - Default inbound/outbound header for correlation ids.
- ROUTE_
ATTRIBUTE - Attribute key written by
UrlMatcher::applyfor the matched route name.
Traits§
- Async
Middleware - Layer that may inspect or mutate the request, then await
AsyncNext::run. - Async
Request Handler - Async controller: turns a request into a response.
- Exception
Handler - Hook invoked when a handler or middleware returns
HttpError. - Middleware
- Layer that may inspect or mutate the request, then call
next. - Request
Handler - Turns a request into a response or an error for the exception mapper.
- Route
Loader - Loads routes into a
RouteCollection.
Functions§
- box_
future - Helper to box an async block as
BoxFuture. - ensure_
request_ id - Resolves or creates a request id, stores it on the request, and returns a clone.
- etag
- Strong
ETag:"tag"(quotes added when missing). - healthz
- Liveness response (
200+ok). - load_
routes - Runs every loader in order into a fresh collection.
- maybe_
not_ modified - Returns a 304 Not Modified when
requestis a conditional GET/HEAD that matches validators onresponse; otherwise returnsresponseunchanged. - readyz
- Readiness response:
200+ready, or503+not ready. - request_
id - Returns the request id from attributes when present.
- weak_
etag - Weak
ETag:W/"tag".
Type Aliases§
- BoxFuture
- Owned future returned by
AsyncRequestHandler::handle.