HTTP routing and request-handling library for Rust that focuses on ergonomics and modularity
open sourceMITself-hostablefree
axum is a Rust web framework from the Tokio project: an HTTP routing and request-handling library that routes requests to handlers with a macro-free API, parses requests declaratively with extractors, and has a simple, predictable error-handling model. It has no middleware system of its own; it uses tower::Service, so timeouts, tracing, compression and authorization come from the tower and tower-http ecosystem and middleware can be shared with hyper and tonic applications. It's a thin layer over hyper with performance comparable to hyper, and is written in 100% safe Rust (#![forbid(unsafe_code)]).
Problems it solves
- write an HTTP API in Rust without a pile of macros on every handler
- parse JSON bodies, path and query parameters into typed Rust structs automatically
- reuse the same timeout, tracing and compression middleware across my Rust HTTP and gRPC services
- a fast, low-overhead async HTTP server in Rust that works with the Tokio ecosystem
- add websockets to a Rust web service
- my Rust web framework feels like a black box and I want plain functions and composable layers
- build a small Rust microservice that handles thousands of requests per second on little memory
- a Rust web server written entirely in safe code
- compose small async handler functions into a Rust HTTP service instead of inheriting from framework classes
Features
- Macro-free routing API
- Declarative request parsing with extractors
- Simple, predictable error handling
- Responses with minimal boilerplate
- tower and tower-http middleware (timeouts, tracing, compression, authorization)
- Middleware shared with hyper and tonic applications
- Thin layer over hyper
- 100% safe Rust
Capabilities
| Takes plugins | plan not known |
|---|
Alternatives
The same job
These do what axum does.
