Expand description
The server layer of rust-web-server:
the HTTP/1.1, HTTP/2 and HTTP/3 servers, TLS, the App and its
controllers, routing, state-aware apps, middleware, MCP, OpenAPI, SSO,
sessions, metrics, OpenTelemetry, the HTTP client and the model layer.
Internal to rust-web-server, released with it at the same version: use
these through the rust_web_server paths, which stay stable; this
crate’s own layout may change in any release. See
spec/WORKSPACE_SPLIT.md.
Modules§
- app
- application
- Application: the type a server runs for every request.
- authz
- Authorization (18.14.0, #32): who the caller is (
Identity), and — from later tranches — what they may do, as relationship-based access control (Zanzibar-style tuples and a schema). - blocklist
- Runtime IP blocklist middleware.
- cache
- In-memory response cache middleware.
- circuit_
breaker - Circuit breaker state machine and retry middleware.
- config_
binding - Typed configuration binding — read environment variables into strongly-typed structs.
- config_
reload - Hot configuration reload.
- config_
watch - Reload when the config file or a certificate changes (
watch = true, #10). - controller
- Controllers: one unit of request handling for
App. - cookie
- di
- Lightweight type-keyed dependency injection container.
- disk_
guard - Keep rws from filling a disk (18.15.0): before writing to a file it
keeps growing — the access log, the disk cache — rws asks
has_room. BelowRWS_CONFIG_MIN_FREE_DISKfree on that file’s filesystem the write is skipped (and counted) until space comes back: a full disk costs log lines and cache entries, never the server or whatever shares the disk with it. - early_
hints 103 Early Hints(RFC 8297, 18.12.0, #38):Linkheaders a client can act on — preload a stylesheet, preconnect to an origin — while the response is still being made.- feature
- Runtime feature toggles.
- http_
client - Outbound HTTP/1.1 client.
- ip_
filter - IP address allowlist and denylist middleware.
- language
- log
- maintenance
- Maintenance mode middleware.
- mcp
- Model Context Protocol (MCP) server — HTTP Streamable HTTP transport.
- metrics
- Server-wide and per-route Prometheus metrics.
- middleware
- Composable middleware pipeline.
- otel
- OpenTelemetry-compatible distributed tracing.
- pagination
- Pagination result types (
Page<T>,CursorPage<T>) and an RFC 8288Linkheader builder. - rate_
limit - request_
id - Request ID / correlation ID middleware.
- request_
log - In-memory ring buffer of recent HTTP requests.
- rewrite
- Request and response rewriting middleware.
- router
- scheduler
- Background task scheduler — a
@Scheduled-style runner for fixed-rate, fixed-delay, and cron-expression tasks. - schema
- JSON Schema for Rust types, for MCP tool
inputSchema/outputSchema. - server
- The listeners and connection loops.
- service_
discovery - Dynamic backend pool with pluggable discovery sources.
- session
- Server-side session management.
- sse
- Server-Sent Events (SSE).
- state
- Shared application state and state-aware routing.
- test_
client - thread_
pool - timeout
- Per-route request timeouts.
- validate
- websocket
- WebSocket protocol support — RFC 6455.
Constants§
- FIPS
- Whether this build uses the FIPS module (
fipsfeature).