Skip to content
Back to skills

Rust Axum Services

ASecurity

Build fast, safe Rust web APIs with Axum routers, typed extractors, Tower middleware, and shared state

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentrustgoapibackend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill rust-axum-services --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rust Axum Services?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rust Axum Services
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-rust-axum-services/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-rust-axum-services)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Build fast, safe Rust web APIs with Axum routers, typed extractors, Tower middleware, and shared state
profile: standard
tags: rust, axum, backend, api
---

# Rust Axum services

Use when building HTTP APIs or middleware in Rust with Axum and Tower.

## Routing and state
- Share pools and clients via `State<AppState>` wrapped in `Arc` instead of per-request initialization or globals.
- Order typed extractors correctly: extractors consuming the body (`Json`, `Bytes`) must come last in handler signatures.
- Return a domain `ApiError` enum implementing `IntoResponse` so internal errors log details internally while returning sanitized JSON.

## Concurrency and middleware
- Apply `tower::ServiceBuilder` with request timeouts, body size limits, and tracing layers at router boundaries.
- Offload CPU-heavy compression, hashing, or parsing with `tokio::task::spawn_blocking` to avoid starving the async executor.
- Use `axum::serve(...).with_graceful_shutdown(...)` so active connections finish before process exit.

## Verify
Run `cargo clippy --all-targets` and `cargo test` using `tower::ServiceExt::oneshot` against router endpoints.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.