Thread-Based Concurrency Patterns

Thread-Based Concurrency Patterns Thread Spawning Best Practices Basic Thread Spawn use std::thread; fn main() { let handle = thread::spawn(|| { println!("Hello from thread!"); 42 // return value });
阅读全文

Async Patterns in Rust

Async Patterns in Rust Task Spawning Basic Spawn use tokio::task; #[tokio::main] async fn main() { // Spawn a task that runs concurrently let handle = task::spawn(async { expensive_computation().await
阅读全文

Common Concurrency Errors & Fixes

Common Concurrency Errors & Fixes E0277: Cannot Send Between Threads Error Pattern use std::rc::Rc; let data = Rc::new(42); std::thread::spawn(move || { println!("{}", data); // ERROR: Rc<i32&g
阅读全文

Concurrency

name: m07-concurrency description: "CRITICAL: Use for concurrency/async. Triggers: E0277 Send Sync, cannot be sent between threads, thread, spawn, channel, mpsc, Mutex, RwLock, Atomic, async, await, F
阅读全文

FinTech Domain

name: domain-fintech description: "Use when building fintech apps. Keywords: fintech, trading, decimal, currency, financial, money, transaction, ledger, payment, exchange rate, precision, rounding, ac
阅读全文

Complete Rules Reference

Complete Rules Reference For the full 500+ rules, see: Source: https://rust-coding-guidelines.github.io/rust-coding-guidelines-zh/ Core rules are in ../SKILL.md.
阅读全文

Rust Coding Guidelines (50 Core Rules)

name: coding-guidelines description: "Use when asking about Rust code style or best practices. Keywords: naming, formatting, comment, clippy, rustfmt, lint, code style, best practice, P.NAM, G.FMT, co
阅读全文

Clippy Lint → Rule Mapping

Clippy Lint → Rule Mapping Clippy LintCategoryFix unwrap_usedErrorUse ? or expect() needless_clonePerfUse reference await_holding_lockAsyncScope guard before await linkedlistPerfUse Vec/VecDeque wildc
阅读全文

Rust Dependencies Visualizer

name: rust-deps-visualizer description: "Visualize Rust project dependencies as ASCII art. Triggers on: /deps-viz, dependency graph, show dependencies, visualize deps, 依赖图, 依赖可视化, 显示依赖"
阅读全文