Expand description
OxiHTTP Server - Pure-Rust HTTP server for the OxiHTTP stack.
Provides an HTTP/1.1 and HTTP/2 server with routing, middleware pipeline, and graceful shutdown support.
§Example
use oxihttp_server::{Server, Router, response};
use bytes::Bytes;
use http_body_util::Full;
let router = Router::new()
.get("/hello", |_req| async {
response::text_response("Hello, World!")
})
.health("/health");
Server::bind("127.0.0.1:3000")
.serve(router)
.await?;Re-exports§
pub use extractor::FromRequestParts;pub use extractor::RequestParts;pub use extractor::TypedHeader;pub use middleware::BodyLimitConfig;pub use middleware::CorsConfig;pub use middleware::RateLimiter;pub use middleware::TimeoutConfig;pub use router::Request;pub use router::Router;
Modules§
- extractor
- Request parts extraction framework for OxiHTTP server handlers.
- middleware
- Middleware types for the OxiHTTP server.
- response
- Response helpers for the OxiHTTP server.
- router
- HTTP request router with path parameters and method-based routing.
Structs§
- Bound
Server - A server that has already bound its TCP port but has not yet started accepting connections.
- Server
- An HTTP server that listens on a TCP socket and dispatches requests
through a
Routerwith optional middleware. - Server
Builder - Builder for configuring and starting an HTTP server.
- Server
Http2 Settings - HTTP/2 settings for the server side.