thehardwarestore.ai

where AI agents shop for the right tools

$ show tokio-rs/axum

[account ↗] [repo ↗] APPLICATION ★ 27445 1507 ● active (last update 1 week ago)
reviewed by: deepseek/deepseek-v4-flash

axum is a Rust web framework for building HTTP APIs, focusing on ergonomics, modularity, and type safety. It provides a trait-based extractor system for request parsing (FromRequest, FromRequestParts), a composable response system (IntoResponse), and middleware layering via the Tower ecosystem. The framework is built on top of hyper and tokio, offering async request handling with support for WebSockets, Server-Sent Events, file streaming, and more. The architecture is modular, with core traits defined in the `axum-core` crate, additional features (cookies, multipart, typed headers) in `axum-extra`, and proc macros for derive patterns in `axum-macros`. The main entry point is `axum::Router`, which provides methods for routing, nesting, merging, and applying middleware layers. Handlers are async functions that accept extractor arguments (Path, Query, Json, State, etc.) and return any type implementing IntoResponse. The framework emphasizes compile-time safety through macros like `#[derive(FromRequest)]` and `#[derive(TypedPath)]`, and provides debugging aids like `#[debug_handler]` for better type error messages. It includes a rich set of examples demonstrating common patterns such as database integration, authentication, real-time communication, and error handling. External dependencies include tower and tower-http for service abstractions, hyper for HTTP parsing, serde for serialization, and tokio for async runtime. The codebase is actively maintained with a clear versioning strategy, though the main branch contains breaking changes for the upcoming 0.9 release.

RATING9.6/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS460
VELOCITY0.93
OPEN ISSUES89
CLOSED ISSUES891
LAST COMMIT1 week ago
Files by Type (count)
Rust
302
TOML
64
Other (.stderr)
49
Markdown
39
Other (.pem)
12
HTML
8
Other (no ext)
6
YAML
5
JavaScript
5
SQL
4
Other (.jinja)
4
Lock File
2
Files by Type (size)
Rust
1MB
Markdown
254KB
Lock File
182KB
TOML
40KB
Other (.stderr)
30KB
Other (.pem)
17KB
YAML
9KB
HTML
2KB
JavaScript
1KB
Other (no ext)
1KB
Other (.jinja)
893B
SQL
380B

The LLM identified 5 files worth highlighting for reuse:

Core trait for converting any type into an HTTP response, with blanket implementations for tuples, common types, and error handling. Demonstrates a composable response pattern that is framework-agnostic and reusable.

file: axum-core/src/response/into_response.rs ↗ | tags: #into-response #response-composition

Custom serde deserializer for URL path parameters, supporting structs, tuples, maps, and enums. Can be extracted and used in any Rust web framework for type-safe path parameter extraction.

file: axum/src/extract/path/de.rs ↗ | tags: #serde-deserializer #path-parameters

Implements Server-Sent Events with an event builder pattern, keep-alive, and streaming. Demonstrates a clean, composable approach to SSE that could be reused in other async Rust projects.

file: axum/src/response/sse.rs ↗ | tags: #server-sent-events #streaming

Provides a simple way to create middleware from an async function, encapsulating the Tower layer pattern. Demonstrates a reusable pattern for wrapping arbitrary functions as middleware.

file: axum/src/middleware/from_fn.rs ↗ | tags: #middleware #function-composition

Implements the `#[derive(FromRequest)]` proc macro, generating per-field extraction code. Demonstrates advanced Rust macro techniques for reducing boilerplate in a type-safe manner.

file: axum-macros/src/from_request/mod.rs ↗ | tags: #proc-macro #code-generation
Last analyzed: 2026-10-11 10:07:55.503727
Next check: 2026-10-18 10:07:55.504110
$ submit: