跳到技能内容
词映 AI导航
发现工具选型指南Skills 技能AI 快讯AI图片AI视频AI文档AI办公AI助手AI搜索AI编程AI音频AI设计AI智能体模型与开发AI学习模型评测AI提示词内容检测AI金融AI 3D扫描与识别其他工具跨境电商 AI
词映 AI导航
工具库Skills 技能
我的收藏
词映 AI导航
发现工具选型指南Skills 技能AI 快讯AI图片AI视频AI文档AI办公AI助手AI搜索AI编程AI音频AI设计AI智能体模型与开发AI学习模型评测AI提示词内容检测AI金融AI 3D扫描与识别其他工具跨境电商 AI
Skills directory/huiali/rust-skills/rust-resource

Codex Rust Resource Ownership with Rc, Arc, and Weak

Choose borrowing or reference counting according to ownership and thread boundaries. Review how weak links affect resource lifetime.

中文

Install in Codex

Codex, a Rust checkout and Cargo. The example uses local practice data.

  1. Copy the pinned `skills/rust-resource/` directory into `.agents/skills/rust-resource/` in the project.
  2. Select `$rust-resource` and describe owners, thread boundaries, and mutation needs.

Example task

In a practice tree, a parent owns child nodes. Ask how a child can refer back to the parent without extending its lifetime.

What to check

The explanation shows how to upgrade the weak parent reference and how to handle a parent that is already gone.

Original SKILL.md on GitHub · Updated 2026-11-13

Frequently asked question

Does read-only single-thread sharing require Arc?

Prefer a borrow where possible. Rc is available when single-thread reference counting is needed.

Related skills from this repository

  • Codex Rust Const Generics for Fixed-Size Buffers
  • Codex Model Missing Values and Parse Failures in Rust
Browse Codex skills in the Chinese directory
词映 AI 导航Skills 技能
工具分类全部工具已本地化技能选型指南AI 快讯