rust-patterns — for Claude Code rust-patterns, community, for Claude Code, ide skills, let y = x, &mut T, anyhow, ### Tokio Async Patterns, async fn, tokio::fs

v1.0.0

关于此技能

适用场景: Ideal for AI agents that need rust systems programming patterns. 本地化技能摘要: # Rust Systems Programming Patterns Description A comprehensive guide to production Rust patterns for 2026. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

功能特性

Rust Systems Programming Patterns
Install this skill to get production-ready Rust patterns including:
Ownership, borrowing, and lifetime rules with concrete mental models
thiserror vs anyhow selection guide for libraries vs applications
Tokio runtime patterns: spawn, select!, streams

# 核心主题

yoogoc yoogoc
[0]
[0]
更新于: 3/30/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 10/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Quality floor passed for review
Review Score
10/11
Quality Score
69
Canonical Locale
en
Detected Body Locale
en

适用场景: Ideal for AI agents that need rust systems programming patterns. 本地化技能摘要: # Rust Systems Programming Patterns Description A comprehensive guide to production Rust patterns for 2026. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

核心价值

推荐说明: rust-patterns helps agents rust systems programming patterns. Rust Systems Programming Patterns Description A comprehensive guide to production Rust patterns for 2026. This AI agent skill supports Claude Code

适用 Agent 类型

适用场景: Ideal for AI agents that need rust systems programming patterns.

赋予的主要能力 · rust-patterns

适用任务: Applying Rust Systems Programming Patterns
适用任务: Applying Install this skill to get production-ready Rust patterns including:
适用任务: Applying Ownership, borrowing, and lifetime rules with concrete mental models

! 使用限制与门槛

  • 限制说明: Structuring async code to avoid blocking the event loop
  • 限制说明: Choosing between database libraries based on project needs
  • 限制说明: Requires repository-specific context from the skill documentation

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

评审后的下一步

先决定动作,再继续看上游仓库材料

Killer-Skills 的主价值不应该停在“帮你打开仓库说明”,而是先帮你判断这项技能是否值得安装、是否应该回到可信集合复核,以及是否已经进入工作流落地阶段。

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

rust-patterns 是什么?

适用场景: Ideal for AI agents that need rust systems programming patterns. 本地化技能摘要: # Rust Systems Programming Patterns Description A comprehensive guide to production Rust patterns for 2026. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

如何安装 rust-patterns?

运行命令:npx killer-skills add yoogoc/xcraw/rust-patterns。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

rust-patterns 适用于哪些场景?

典型场景包括:适用任务: Applying Rust Systems Programming Patterns、适用任务: Applying Install this skill to get production-ready Rust patterns including:、适用任务: Applying Ownership, borrowing, and lifetime rules with concrete mental models。

rust-patterns 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

rust-patterns 有哪些限制?

限制说明: Structuring async code to avoid blocking the event loop;限制说明: Choosing between database libraries based on project needs;限制说明: Requires repository-specific context from the skill documentation。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add yoogoc/xcraw/rust-patterns。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    rust-patterns 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

rust-patterns

# Rust Systems Programming Patterns Description A comprehensive guide to production Rust patterns for 2026. This AI agent skill supports Claude Code, Cursor

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Rust Systems Programming Patterns

Description

A comprehensive guide to production Rust patterns for 2026. Covers ownership and borrowing mental models, error handling with thiserror/anyhow, async concurrency with Tokio, web services with Axum, database access (SQLx, Diesel, SeaORM), CLI development, WebAssembly, and Python bindings via PyO3. Targets Rust Edition 2024 (1.85.0+).

Usage

Install this skill to get production-ready Rust patterns including:

  • Ownership, borrowing, and lifetime rules with concrete mental models
  • thiserror vs anyhow selection guide for libraries vs applications
  • Tokio runtime patterns: spawn, select!, streams
  • Axum web server: routing, extractors, middleware, shared state
  • Concurrency primitives: Arc, Mutex, RwLock, channels, Rayon

When working on Rust projects, this skill provides context for:

  • Deciding when to clone vs borrow vs move
  • Structuring async code to avoid blocking the event loop
  • Choosing between database libraries based on project needs
  • Building CLI tools with Clap v4 derive API
  • Creating Python extension modules with PyO3

Key Patterns

Ownership Mental Model

Think of ownership like a title deed:

  • Move (let y = x): You transfer the deed. x is no longer valid.
  • Immutable borrow (&T): Multiple readers simultaneously, no modifications.
  • Mutable borrow (&mut T): One exclusive borrower who can modify. No others inside.
rust
1// Quick pattern reference 2fn risky() -> Result<T, E> { 3 let x = operation()?; // ? operator: early return on error 4 Ok(x) 5} 6 7// Shared mutable state across threads 8let data = Arc::new(Mutex::new(vec![])); 9let clone = Arc::clone(&data); 10tokio::spawn(async move { clone.lock().unwrap().push(1); });

Error Handling: thiserror vs anyhow

Use anyhow for applications (add context to error chains):

rust
1use anyhow::{Result, Context}; 2 3fn main() -> Result<()> { 4 let data = std::fs::read_to_string("user.json") 5 .context("could not read user.json")?; 6 Ok(()) 7}

Tokio Async Patterns

rust
1// Multi-threaded runtime 2#[tokio::main(flavor = "multi_thread", worker_threads = 4)] 3async fn main() { ... } 4 5// Race futures: select! picks the first to complete 6let winner = tokio::select! { 7 result = slow_future() => result, 8 result = fast_future() => result, 9 _ = tokio::time::sleep(Duration::from_secs(5)) => "timeout", 10}; 11 12// Blocking code inside async: use spawn_blocking 13let data = tokio::task::spawn_blocking(|| { 14 std::fs::read_to_string("file.txt") 15}).await.unwrap();

Anti-pattern: blocking sync I/O inside async fn. Use tokio::fs instead of std::fs.

Axum Web Server

rust
1use axum::{Router, routing::{get, post}, Json, http::StatusCode}; 2use std::sync::Arc; 3 4#[derive(Clone)] 5struct AppState { db_url: String } 6 7async fn create_user(Json(user): Json<User>) -> (StatusCode, Json<User>) { 8 (StatusCode::CREATED, Json(user)) 9} 10 11#[tokio::main] 12async fn main() { 13 let state = Arc::new(AppState { db_url: "postgres://...".into() }); 14 let app = Router::new() 15 .route("/users", post(create_user)) 16 .with_state(state); 17 let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); 18 axum::serve(listener, app).await.unwrap(); 19}

Concurrency Primitives

rust
1// Arc<Mutex<T>>: shared mutable state across threads 2let counter = Arc::new(Mutex::new(0)); 3for _ in 0..10 { 4 let c = Arc::clone(&counter); 5 thread::spawn(move || { *c.lock().unwrap() += 1; }); 6} 7 8// RwLock: multiple readers OR one writer 9let data = Arc::new(RwLock::new(vec!["a", "b"])); 10let read = data.read().unwrap(); // shared read 11let write = data.write().unwrap(); // exclusive write 12 13// Rayon: parallel iterators (automatic work-stealing) 14use rayon::prelude::*; 15let sum: u64 = (1..=1_000_000).collect::<Vec<_>>().par_iter().sum();

Prefer channels over Arc<Mutex> for message-passing patterns.

Clap v4 CLI (Derive API)

rust
1use clap::{Parser, Subcommand}; 2 3#[derive(Parser)] 4#[command(name = "myapp", about = "My CLI tool")] 5struct Cli { 6 #[arg(short, long)] verbose: bool, 7 #[command(subcommand)] command: Commands, 8} 9 10#[derive(Subcommand)] 11enum Commands { 12 Process { #[arg(short, long)] format: String }, 13 Download { url: String }, 14}

Anti-Patterns to Avoid

Anti-PatternBetter Approach
Over-cloning to bypass borrow checkerUse references &T instead
Arc<Mutex<T>> everywhereSingle owner + mutable ref, or channels
.unwrap() in library codeReturn Result<T, E>
Sync I/O in async functionsUse tokio::fs, spawn_blocking

Tools & References


Published by MidOS — MCP Community Library

相关技能

寻找 rust-patterns 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具