Expand description
HTTP Server for What framework
File-based routing with automatic page rendering and form handling.
Structs§
- Action
Handler - Handler for processing actions
- AppState
- Application state shared across handlers
- Fetch
Debug Entry - Debug info for a single remote fetch (used in X-What-Debug header)
- Rate
Limiters - Per-IP rate limiters using moka caches with TTL-based sliding windows. Each cache maps IP address string to request count.
- Render
Engine - Template rendering engine using html5ever for parsing
- Render
Result - Result of rendering content
- Wired
Message - A wired message with its scope for filtering
Enums§
- CssMode
- Which slice of the embedded framework stylesheet an app serves.
Configured via
[server] cssin what.toml. - Live
Reload Message - Live reload message type
Functions§
- content_
dir - Resolve the full content directory path for a project root.
- content_
dir_ name - Determine the content directory name for a project root.
- create_
router - Create the application router
- discover_
routes - Discover all page routes from the content directory (site/ or pages/).
Returns (url_path, is_dynamic) pairs. Dynamic routes have
[id]segments. - embedded_
what_ css - The framework CSS embedded in this crate (crates/what-core/assets/client/what.css). Exposed so downstream crates that vendor their own copy can assert it hasn’t drifted.
- embedded_
what_ css_ for_ mode - The embedded framework CSS for a given mode — used by the CLI’s static build.
- embedded_
what_ js - The framework JS embedded in this crate (crates/what-core/assets/client/what.js). Exposed so downstream crates that vendor their own copy can assert it hasn’t drifted.
- render_
page_ to_ html - Render a page to static HTML for pre-rendering / build output.
- serve
- Start the What server
- serve_
on_ listener - Serve on an already-bound listener. Lets callers bind first — surfacing port-in-use errors before printing any success banner — then serve.
- serve_
with_ shutdown - Start the server with graceful shutdown support.
The
shutdownfuture resolves when the server should stop accepting new connections.