
M14 Mental Model
A learning guide that maps core Rust concepts to mental models, analogies, and common compiler-error misconceptions.
- skills.sh installs
- 3.6K
- GitHub stars
- 1.6K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers ownership, borrowing, lifetimes, and smart pointers, each paired with a plain-language analogy
- Includes a table of common misconceptions by error code (E0382, E0502, E0499, E0106, E0507) with corrected models
- Adds comparisons for developers coming from Java, C/C++, Python, Go, and JavaScript, plus stack and heap diagrams
- Designed for developers learning Rust who need intuition for why the borrow checker rejects code
Install
$ npx -y skills add actionbook/rust-skills --skill m14-mental-model -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Mental Models
Layer 2: Design Choices
Core Question
What's the right way to think about this Rust concept?
When learning or explaining Rust:
- What's the correct mental model?
- What misconceptions should be avoided?
- What analogies help understanding?
Key Mental Models
| Concept | Mental Model | Analogy |
|---|---|---|
| Ownership | Unique key | Only one person has the house key |
| Move | Key handover | Giving away your key |
&T | Lending for reading | Lending a book |
&mut T | Exclusive editing | Only you can edit the doc |
Lifetime 'a | Valid scope | "Ticket valid until..." |
Box<T> | Heap pointer | Remote control to TV |
Rc<T> | Shared ownership | Multiple remotes, last turns off |
Arc<T> | Thread-safe Rc | Remotes from any room |
Coming From Other Languages
| From | Key Shift |
|---|---|
| Java/C# | Values are owned, not references by default |
| C/C++ | Compiler enforces safety rules |
| Python/Go | No GC, deterministic destruction |
| Functional | Mutability is safe via ownership |
| JavaScript | No null, use Option instead |
Thinking Prompt
Details
- Repository
- github.com/actionbook/rust-skills
- Categories
- Rust, Learning & Teaching
- First seen
- May 16, 2026
More from actionbook/rust-skills
All 38- M13 Domain Error3.6K
- M11 Ecosystem3.6K
- Unsafe Checker3.6K
- Rust Code Navigator3.6K
- Rust Trait Explorer3.5K
- Rust Call Graph3.5K
- Rust Symbol Analyzer3.5K
- Domain Web3.5K
- Domain Cli3.5K
- Rust Learner3.4K
- Rust Skill Creator3.4K
- Rust Deps Visualizer3.3K
- Meta Cognition Parallel3.3K
- Rust Daily3.3K
- Domain Embedded3.2K
- Domain Cloud Native3.2K
- Domain Fintech3.1K
- Domain Ml3.1K
- Domain Iot3K
- Rust Router3K
- Core Agent Browser2.3K
- Core Dynamic Skills2.1K
- Core Actionbook2.1K
- Core Fix Skill Docs2.1K
Similar to M14 Mental Model
More Rust
m01-ownershipactionbook/rust-skills3.7K installsRust ownership and lifetime error guide that maps compiler codes to design questions before quick fixes.
m02-resourceactionbook/rust-skills3.7K installsChoosing Rust smart pointers by ownership model, thread context, and reference cycles, with a decision flowchart.
rust-best-practicesapollographql/skills23.4K installsIdiomatic Rust guidance covering ownership, error handling, performance, linting, testing, and documentation, drawn from Apollo's handbook.
rust-systems-programmingmanutej/luxor-claude-marketplace489 installsComplete Rust guide covering ownership, borrowing, concurrency, async, and unsafe code for memory-safe systems work.
rust-engineerjeffallan/claude-skills6.8K installsIdiomatic Rust engineering skill covering ownership, lifetimes, traits, async tokio, and error handling.
rust-patternsaffaan-m/ecc6.7K installsIdiomatic Rust patterns for ownership, error handling, enums, traits, iterators, and concurrency in production code.