What problem does it solve?
Helps Rust developers choose appropriate smart pointers and resource-management primitives to avoid unnecessary heap allocations, reference cycles, runtime borrow panics, and incorrect thread-safety choices when designing data ownership and access patterns.
Core Features & Use Cases
- Ownership decision flow: Guides whether to use Box, Rc, Arc, or Weak based on single vs shared ownership and cycle risks.
- Thread-safety and interior mutability guidance: Recommends Rc/Arc combinations with RefCell, Cell, Mutex, or RwLock according to single-threaded or multi-threaded contexts.
- Error mitigation and anti-patterns: Identifies common pitfalls (RefCell panics, Rc cycles, unnecessary Arc overhead) and prescribes practical fixes and design questions to ask in reviews.
Use case: When refactoring a data structure that moves to a background worker thread, consult this Skill to determine if Rc should be replaced with Arc and where Weak references must break cycles.
Quick Start
Use this skill to decide whether to use Box, Rc, Arc, Weak, RefCell, or Cell for a Rust value given its ownership model and threading requirements.