templates/template-rust
CLAUDE.md for Rust applications and libraries
CLAUDE.md template for Rust projects. Covers Cargo workspace setup, common patterns, error handling with thiserror/anyhow, async with Tokio, and testing strategies for Rust code.
Content
# Rust Project ## Overview Rust application/library with modern tooling. ## Tech Stack - Language: Rust (stable) - Async: Tokio - Web: Axum/Actix-web - Serialization: serde ## Key Commands ```bash cargo run # Run project cargo build --release # Release build cargo test # Run tests cargo clippy # Lint cargo fmt # Format code cargo doc --open # Generate docs ``` ## Project Structure ``` / ├── src/ │ ├── main.rs # Entry (binary) │ ├── lib.rs # Library root │ ├── error.rs # Error types │ └── modules/ # Feature modules ├── tests/ # Integration tests ├── benches/ # Benchmarks ├── Cargo.toml # Dependencies └── Cargo.lock # Lock file ``` ## Conventions - Use `Result<T, E>` for fallible ops - Implement `From` for error conversion - Prefer `&str` over `String` in params - Use `#[derive]` for common traits ## Important Notes - Run clippy before committing - Use `#[cfg(test)]` for test modules - Feature flags for optional deps
Details
| Category | templates |
| Tags | rustcliadvanced |
| Language | Markdown |
| License | MIT |
| Author | Claude Code Directory |
| Difficulty | advanced |
Pairs with
templates/template-typescript-monorepo
CLAUDE.md for Turborepo/Nx monorepo projects
templates/template-nextjs
Comprehensive CLAUDE.md for Next.js App Router projects
templates/template-python-fastapi
Complete CLAUDE.md for FastAPI backend projects
templates/template-nodejs-express
Battle-tested CLAUDE.md for Express.js API projects