domain-web

Enforce domain constraints for Rust REST APIs with Axum or Actix.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/AlexKVal/rust-skills-for-cursor --skill domain-web-alexkval
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-web
Source: https://github.com/AlexKVal/rust-skills-for-cursor/tree/main/skills/domain-web
Command: npx skills add https://github.com/AlexKVal/rust-skills-for-cursor --skill domain-web-alexkval

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Domain constraints for Rust web services are often under-communicated: developers struggle to enforce non-blocking I/O, thread-safe shared state, and clear ownership patterns across frameworks like Axum and Actix. This skill provides a structured set of rules and patterns to guide design decisions and prevent common pitfalls.

Core Features & Use Cases

  • Enforces non-blocking handlers, explicit error handling, and Send + Sync guarantees for high-concurrency web apps.
  • Promotes Arc-based shared state management and avoids Rc in server state.
  • Provides framework-agnostic design guidance with concrete Axum/Actix examples and best-practice patterns.
  • Use Case: architect a REST API service with stateless handlers and scalable state management across workers.

Quick Start

Start by wiring a basic Axum handler that stores shared state in Arc and exposes a non-blocking endpoint.

Frequently Asked Questions about domain-web

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage shared state safely in Rust web services using Axum or Actix?

Manage shared state in Rust web services by wrapping it in Arc and enforcing Send + Sync bounds, which ensures thread-safe access across non-blocking handlers and multiple worker threads without data races.

What's the best way to enforce non-blocking handlers in a Rust REST API?

Enforce non-blocking handlers in a Rust REST API by adopting async I/O patterns and avoiding blocking operations inside request handlers, ensuring the thread pool remains free to process concurrent requests efficiently.

Why does my Rust web server panic when sharing state across threads?

Rust web servers panic when sharing state across threads if the state lacks Send + Sync guarantees or uses Rc, which is not thread-safe; switching to Arc-based state management enforces the required ownership and concurrency constraints.

Do I need to avoid Rc when building scalable Rust microservices?

Yes, you must avoid Rc when building scalable Rust microservices because it is single-threaded; use Arc-based sharing instead to satisfy Send + Sync state requirements for safe, high-concurrency web app architectures.

How do I structure explicit error handling in Rust async web frameworks?

Structure explicit error handling in Rust async web frameworks by returning structured error types from non-blocking handlers instead of unwinding, ensuring predictable API responses and stable worker thread execution under concurrent load.

Can I build framework-agnostic Rust web services that work with both Axum and Actix?

Yes, you can build framework-agnostic Rust web services by applying domain constraints like Arc-based state sharing and explicit error handling through structured patterns, allowing the same design to map cleanly onto both Axum and Actix implementations.