axum
Installation
SKILL.md
Axum — Rust Web Framework
Axum is an ergonomic and modular web framework built on top of Tokio, Tower, and Hyper. It is maintained by the tokio-rs team and provides a first-class async experience for building HTTP services in Rust. Axum's design revolves around converting handler functions into services via traits like FromRequest and IntoResponse, making it both intuitive to use and deeply composable with the Tower middleware ecosystem. It supports HTTP/1 and HTTP/2 out of the box, WebSocket upgrades, Server-Sent Events, and integrates seamlessly with the broader tokio ecosystem.
Crate Architecture
| Crate | Version | Purpose |
|---|---|---|
axum |
0.8.9 | Main crate — routing, handlers, extractors (Path, Query, Json, Form, Bytes, WebSocket, Multipart), middleware, SSE, body types |
axum-core |
0.5.6 | Core traits (FromRequest, FromRequestParts, IntoResponse, IntoResponseParts), body types, error types, middleware primitives |
axum-extra |
0.12.6 | Extended extractors: CookieJar, SignedCookieJar, PrivateCookieJar, TypedHeader, Host, Either/Either3..8, OptionalQuery, Cached, JsonDeserializer, ErasedJson, JsonLines, WithRejection, TypedPath, AsyncReadBody, FileStream, Attachment, ErrorResponse |
axum-macros |
0.5.1 | Procedural macros: #[debug_handler], #[debug_middleware], TypedPath derive |
tower-http |
0.6.x | Production-ready middleware layers: CORS, tracing, compression, timeouts, auth, rate limiting, static file serving, request IDs |
tower |
0.5.x | Service trait, ServiceBuilder, ServiceExt — the middleware foundation axum builds upon |
tokio |
1.x | Async runtime, TCP listener, signal handling, file I/O |
hyper |
1.4+ | Low-level HTTP server/client (axum's HTTP implementation) |
matchit |
0.9.x | Path matching engine used by axum's router |