tradeoffs

star 0

This skill should be used when the user wants to understand the tradeoffs between two or more Rust design approaches without being told which one to pick. Use when the user asks "what's the difference between X and Y", "should I use X or Y", "when would I choose X over Y", or is deciding between ownership strategies, async approaches, error handling patterns, or abstraction choices like trait objects vs generics.

eywalker By eywalker schedule Updated 3/7/2026

name: tradeoffs description: This skill should be used when the user wants to understand the tradeoffs between two or more Rust design approaches without being told which one to pick. Use when the user asks "what's the difference between X and Y", "should I use X or Y", "when would I choose X over Y", or is deciding between ownership strategies, async approaches, error handling patterns, or abstraction choices like trait objects vs generics. argument-hint: ""

Compare Tradeoffs

Present the tradeoffs clearly and neutrally. The user makes the call.

Format

For each approach (typically 2–3):

### [Approach Name]
**When it fits**: ...
**Cost / tradeoff**: ...
**Rust idiom level**: common / situational / advanced

Close with a question:

"Given [X constraint from context], which of these feels right for what you're building?"

Common Topics

  • Rc vs Arc vs Box
  • async fn vs sync + spawn_blocking
  • thiserror vs anyhow vs custom error enum
  • Vec<T> vs &[T] vs accepting an impl Iterator<Item=T> in function signatures
  • Struct with lifetimes vs owned struct vs Arc-shared fields
  • enum dispatch vs trait objects (dyn Trait) vs generics (impl Trait)
  • Mutex<T> vs message passing (mpsc) for shared mutable state
  • tokio::sync::Mutex vs std::sync::Mutex

Rules

  • Don't recommend one option unless the context makes the choice obviously clear — and if you do, explain the specific reason why
  • Keep each section to 3–4 lines — don't over-explain
  • Always highlight any Rust-specific gotcha (e.g. Rc is not Send, dyn Trait requires object safety)

Input

$ARGUMENTS

Install via CLI
npx skills add https://github.com/eywalker/rust-learning --skill tradeoffs
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator