Rust web-service guide that maps domain constraints to axum, actix, tower, and shared-state patterns.

skills.sh installs
3.5K
GitHub stars
1.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers async handlers, thread-safe shared state, request-scoped extractors, and tower middleware layers for Rust web services
  • Includes a framework comparison (axum, actix-web, warp, rocket), a key-crates table, and an axum handler with unified error responses
  • Enforces rules such as no blocking in handlers (use spawn_blocking) and Arc for state shared across threads
  • Designed for Rust developers building HTTP, REST, or WebSocket services who need design guidance beyond the framework API

Install

$ npx -y skills add actionbook/rust-skills --skill domain-web -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Web Domain

Layer 3: Domain Constraints

Domain Constraints → Design Implications

Domain RuleDesign ConstraintRust Implication
Stateless HTTPNo request-local globalsState in extractors
ConcurrencyHandle many connectionsAsync, Send + Sync
Latency SLAFast responseEfficient ownership
SecurityInput validationType-safe extractors
ObservabilityRequest tracingtracing + tower layers

Critical Constraints

Async by Default

RULE: Web handlers must not block
WHY: Block one task = block many requests
RUST: async/await, spawn_blocking for CPU work

State Management

RULE: Shared state must be thread-safe
WHY: Handlers run on any thread
RUST: Arc<T>, Arc<RwLock<T>> for mutable

Request Lifecycle

RULE: Resources live only for request duration
WHY: Memory management, no leaks
RUST: Extractors, proper ownership

Trace Down ↓

From constraints to design (Layer 2):

"Need shared application state"
    ↓ m07-concurrency: Use Arc for thread-safe sharing
    ↓ m02-resource: Arc<RwLock<T>> for mutable state

Details

Repository
github.com/actionbook/rust-skills
Categories
Rust, Backend & APIs
First seen
May 16, 2026

More from actionbook/rust-skills

All 38

Similar to Domain Web

More Rust