Expand description
rustlavel-http: the HTTP layer, written from scratch on Tokio’s TCP.
Parsing, routing, the middleware pipeline, request and response types, the development error page, and a test client that dispatches without a socket.
Re-exports§
pub use body_limit::BodyLimit;pub use compression::Compress;pub use cookie::Cookie;pub use cookie::SameSite;pub use cors::Cors;pub use etag::ETag;pub use files::Files;pub use handler::Handler;pub use health::Health;pub use headers::Headers;pub use json_resource::Attributes;pub use json_resource::JsonResource;pub use json_resource::ResourceResponse;pub use json_resource::attributes;pub use method::Method;pub use middleware::Middleware;pub use middleware::Next;pub use plugin::Plugin;pub use plugin::Setup;pub use request::Request;pub use request_id::RequestId;pub use response::IntoResponse;pub use response::Response;pub use router::Resource;pub use router::Route;pub use router::RouteHandle;pub use router::Router;pub use server::Limits;pub use server::Server;pub use status::Status;pub use testing::TestClient;pub use testing::TestResponse;pub use timeout::Timeout;pub use upgrade::Upgrade;pub use upgrade::Upgraded;pub use versioning::ApiVersion;pub use versioning::VersionHeader;
Modules§
- body_
limit - A per-route ceiling on the request body.
- compression
- Response compression.
- cookie
- Cookie construction and parsing.
- cors
- Cross-Origin Resource Sharing.
- date
- HTTP dates:
Date,Last-Modified,If-Modified-Since,Expires. - error_
page - The development error page.
- etag
- Entity tags and conditional requests.
- files
- Serving static files out of a directory, for
public/. - handler
- headers
- Case-insensitive header storage.
- health
- Health endpoints, for whatever is deciding whether to send traffic here.
- json_
resource - API resources: one place per type that decides how it appears as JSON.
- method
- middleware
- The middleware pipeline.
- panic
- Catching panics inside a handler so one bad request cannot take down the connection — and so the dev error page can show where it happened.
- plugin
- How an optional package attaches itself to an application.
- request
- request_
id - One identifier per request, from the first log line to the response header.
- response
- router
- The router: what an application’s
routes/web.rsfills in. - server
- The HTTP/1.1 server: accept loop, request parsing, keep-alive, and a graceful shutdown that lets in-flight requests finish.
- status
- testing
- The test client.
- timeout
- A ceiling on how long a handler may run.
- upgrade
- Handing a connection over to another protocol.
- url
- Percent-encoding and query-string handling.
- versioning
- API versions, and telling clients when one is going away.