Skip to main content

Module app

Module app 

Source
Expand description

axum application factory + shared state + signed-request middleware.

Structs§

AppState
Application state shared by every route. The single SQLite connection is wrapped in a Mutex since rusqlite is sync-only; handlers acquire the lock briefly. For long-running queries we’d spawn_blocking, but the workload here is microsecond-scale.
SignedSession
Carries the verified auth::Session into the route handler via Extension<SignedSession>.

Functions§

build_state
Wrap a Connection in shared state and apply schema bootstrap + the server task-signing key initialisation.
build_state_in_memory
create_app
Build the axum Router with every route and middleware wired up.
signed_request
Middleware factory that:
username_for
Resolve user_id -> username for audit log actor strings.