axum-docs
Installation
SKILL.md
Axum 0.8.x — Rust Web Framework
Overview
Axum is a ergonomic and modular web framework built with Tokio, Hyper, and Tower. It provides a macro-free API for routing, declarative request parsing via extractors, predictable error handling, and seamless integration with the Tower ecosystem of middleware and services.
Key Principles
- Macro-free routing: Routes are defined via
Router::new().route(path, method_router). - Extractors: Request parsing is done via types implementing
FromRequest/FromRequestParts. - IntoResponse: Anything implementing
IntoResponsecan be returned from handlers. - Tower integration: No bespoke middleware system — uses
tower::Serviceandtower::Layerdirectly. - Type-safe state: State is threaded through the type system via
Router<S>andwith_state(). - Infallible by design: All services must have
Infallibleas their error type — errors become responses.