Skip to main content

Module server

Module server 

Source
Expand description

HTTP Server for What framework

File-based routing with automatic page rendering and form handling.

Structs§

ActionHandler
Handler for processing actions
AppState
Application state shared across handlers
FetchDebugEntry
Debug info for a single remote fetch (used in X-What-Debug header)
RateLimiters
Per-IP rate limiters using moka caches with TTL-based sliding windows. Each cache maps IP address string to request count.
RenderEngine
Template rendering engine using html5ever for parsing
RenderResult
Result of rendering content
WiredMessage
A wired message with its scope for filtering

Enums§

ActivityEvent
One entry in the dev inspector’s activity feed.
CssMode
Which slice of the embedded framework stylesheet an app serves. Configured via [server] css in what.toml.
LiveReloadMessage
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 shutdown future resolves when the server should stop accepting new connections.