Expand description
HTTP abstraction traits: IHttpContext, IHttpRequest, IHttpResponse.
This module defines the core interfaces for HTTP request/response handling in the rust-webx framework. All types are defined as traits to enable testability and middleware composition.
§Traits
IHttpContext— The central context for a single HTTP request, providing access to request, response, and authentication claims.IHttpRequest— Read-only access to the incoming HTTP request.IHttpResponse— Mutable access to the outgoing HTTP response.IClaimsExt— Extension for storing/retrieving authentication claims.
Request structs are bound by webx_core::route::binding::RequestModel,
which #[derive(WebxRequestMeta)] implements.
§Helpers
read_json_body— Deserialize JSON from the request body.write_json_response— Serialize a value as JSON into the response.
Structs§
- Byte
Range - An inclusive byte range, as requested by a
Rangeheader. - File
Body - A file response — the rust-webx counterpart of ASP.NET Core’s
File(...)/PhysicalFile(...)/Results.File(...). - Http
Status - Common HTTP status codes.
Enums§
- Disposition
- How a file response should be presented.
- File
Source - Where a file response’s bytes come from.
- Response
Body - The body of an HTTP response.
Constants§
- STREAM_
BUF_ SIZE - Read/write buffer size used for streamed response bodies and spooled uploads.
Traits§
- IClaims
Ext - Extension trait that adds claims storage to an
IHttpContext. - IHttp
Context - HTTP context encapsulating the request, response, and service provider for the duration of a single HTTP request.
- IHttp
Request - HTTP request abstraction.
- IHttp
Response - HTTP response abstraction.
- Seekable
Reader - An async reader that can also seek.
Functions§
- content_
disposition_ value - Build a
Content-Dispositionheader value (RFC 6266). - read_
json_ body - Helper: read JSON from the request body.
- write_
json_ response - Helper: build a JSON response by serializing a value and writing it.
Type Aliases§
- Json
- Type alias for JSON responses in controller methods.