rust-backend-guidelines

Design Rust backends with Axum or Actix-web routing, state, middleware, and error handling.

Updated Dec 13, 2025
One-click install
npx skills add https://github.com/imehr/vet --skill rust-backend-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-backend-guidelines
Source: https://github.com/imehr/vet/tree/main/.claude/skills/rust-backend-guidelines
Command: npx skills add https://github.com/imehr/vet --skill rust-backend-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing reliable Rust backends across Axum and Actix-web can be challenging without a clear architectural blueprint. This Skill consolidates patterns, conventions, and practical recipes to accelerate API development while maintaining quality and consistency.

Core Features & Use Cases

  • Pattern-based routing and organization for scalable APIs.
  • Extractors, state management, and error handling to reduce boilerplate.
  • Middleware and service-layer abstractions to separate concerns and improve testability.
  • Use Case: Build a microservice with a health endpoint, CRUD handlers, and shared state.

Quick Start

Create a minimal Axum/Actix-web project structure with a health check route and a simple service layer to demonstrate routing, state, and error handling.

Frequently Asked Questions about rust-backend-guidelines

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

FAQPage Schema
How do I structure a Rust backend using Axum or Actix-web?

Structure a Rust backend by enforcing a clear separation of concerns: organize routers logically, apply request extractors, manage shared state, and isolate business logic in a service layer to reduce boilerplate and improve testability.

What's the best way to handle shared state in Rust API services?

Handle shared state in Rust API services by passing it through framework-specific state management mechanisms, allowing handlers to access common data like database pools or configuration safely across concurrent requests.

How does middleware work for separating concerns in Rust microservices?

Middleware in Rust microservices works by wrapping request handlers to process requests before or after they reach the core service layer, enabling structured error handling, logging, and authentication without cluttering business logic.

Can I use this approach for building internal tooling with CRUD handlers?

Yes, you can use this approach for internal tooling because it provides concrete Rust examples for building minimal project structures, including health endpoints and CRUD handlers with robust error handling.

When do I need a service layer abstraction in my Rust backend?

You need a service layer abstraction in your Rust backend when you want to separate business logic from routing and request extraction, which improves testability and ensures your API remains maintainable as it scales.

How do I reduce boilerplate in Rust API request handling?

Reduce boilerplate in Rust API request handling by leveraging framework extractors to automatically deserialize and validate incoming data, allowing handlers to focus directly on core business logic.