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
RcvsArcvsBoxasync fnvs sync +spawn_blockingthiserrorvsanyhowvs custom error enumVec<T>vs&[T]vs accepting animpl Iterator<Item=T>in function signatures- Struct with lifetimes vs owned struct vs
Arc-shared fields enumdispatch vs trait objects (dyn Trait) vs generics (impl Trait)Mutex<T>vs message passing (mpsc) for shared mutable statetokio::sync::Mutexvsstd::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.
Rcis notSend,dyn Traitrequires object safety)
Input
$ARGUMENTS