rs-memory-safety

Installation
SKILL.md

Rust Memory Safety

Rust's borrow checker is a strict but fair mentor. This skill codifies the patterns for working with it effectively.

The Trinity of Ownership

  1. Ownership: Each value has a single owner.
  2. Borrowing:
    • Unlimited immutable borrows (&T).
    • EXACTLY ONE mutable borrow (&mut T) at a time.
  3. Lifetimes: Ensuring references are never valid longer than the data they point to.

Smart Pointers

  • Box<T>: Heap allocation for data with a known size at compile time.
  • Rc<T> / Arc<T>: Reference counting for shared ownership (Arc is thread-safe).
  • RefCell<T>: Interior mutability (checked at runtime).
Installs
1
GitHub Stars
1
First Seen
Jun 29, 2026
rs-memory-safety — jcorpac/ai-skills-library