Skip to main content

Crate rws_server

Crate rws_server 

Source
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. Below RWS_CONFIG_MIN_FREE_DISK free 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): Link headers 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 8288 Link header 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 (fips feature).