m02-resource

A short, memorable phrase that identifies the product and differentiates it from competitors.

Updated Jan 21, 2026
One-click install
npx skills add https://github.com/lywa1998/self-host-claude-marketplace --skill m02-resource-lywa1998
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: m02-resource
Source: https://github.com/lywa1998/self-host-claude-marketplace/tree/main/plugins/rust-skills/skills/m02-resource
Command: npx skills add https://github.com/lywa1998/self-host-claude-marketplace --skill m02-resource-lywa1998

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guidance for selecting the correct Rust smart pointer strategy to manage ownership and lifetimes safely and efficiently.

Core Features & Use Cases

  • Ownership pattern guidance: choose between Box, Rc, Arc, and Weak based on ownership and sharing requirements.
  • Mutability decisions: determine when to pair Rc/Arc with RefCell or Mutex for interior mutability.
  • Cycle prevention: apply Weak to break reference cycles in graph-like structures.

Quick Start

Demonstrate how to decide between Box, Rc, and Arc for a given ownership pattern in Rust.

Frequently Asked Questions about m02-resource

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between Box, Rc, and Arc for Rust ownership?

Select Rust smart pointers by thread safety: Box for exclusive heap allocation, Rc for single-threaded sharing, and Arc for multi-threaded sharing.

When should I use RefCell or Mutex for interior mutability in Rust?

Use RefCell for interior mutability in single-threaded contexts with Rc, and Mutex or RwLock with Arc when you need mutable access across multiple threads safely.

How do I prevent memory leaks when building graph structures in Rust?

Prevent memory leaks in Rust graph structures by using Weak references to break reference cycles, which avoids indefinite node retention.

What is the best way to share mutable data across threads in Rust?

The best way to share mutable data across threads in Rust is combining Arc with Mutex or RwLock, providing thread-safe shared ownership with synchronized interior mutability.

Does Rust smart pointer selection depend on single-threaded vs multi-threaded context?

Yes, Rust smart pointer selection depends on threading: Rc and RefCell suit single-threaded scenarios, while Arc and Mutex or RwLock are required for multi-threaded sharing.