Skip to main content

Module handlers

Module handlers 

Source
Expand description

Axum handlers for the three public endpoints.

All handlers are async, but every one that touches the database delegates SQLite work to AppState::with_connection, which runs on Tokio’s blocking-task pool. The handlers themselves do parsing, parameter validation, and response shaping — nothing else.

GET /version is the exception: it returns compile-time constants only and never opens the database.

Structs§

QueryParams
Query-string parameters accepted by GET /query.
StatsResponse
Wire shape for GET /stats responses.
VersionResponse
Wire shape for GET /version responses.

Functions§

query_handler
GET /query?q=<expr>&limit=<n>
stats_handler
GET /stats
version_handler
GET /version