Axum Cheat Sheet

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The reference material consulted while preparing these pages is listed in the section bibliography.

A single-page, colour-coded summary of web development with axum, written against axum 0.8.9, tokio 1.53 and tower-http 0.7.1 on Rust 1.99 (checked 2026-10-06) — the tokio, hyper, tower and axum stack with a request’s life, the Cargo.toml and main.rs skeleton with axum::serve and graceful shutdown, routing with {param} and {*rest} captures, nest, merge and fallbacks, the extractor table with the body-extractor-last rule and optional extractors, responses and an AppError recipe, State, FromRef and Extension, middleware with from_fn and the layer-ordering rules, the tower-http layers with body limits, timeouts and CORS, validation and utoipa snippets, sqlx pool, query, transaction and migration one-liners, a sessions, passwords, JWT, OAuth2 and CSRF checklist, askama with htmx, WebSocket, SSE and multipart skeletons, tracing, OpenTelemetry and metrics setup, testing with oneshot and axum-test, a deployment checklist, and a strip of what changed since older tutorials — handy for quick memorization or as a downloadable PDF desk reference.

For the full explanation, every option, and additional examples, see the dedicated pages:

Start here — Axum.

References

The PDF summarizes the official documentation; each source is cited in full on the page listed above that covers it, and in the section bibliography.