·m02-resource
</>

m02-resource

zhanghandong/rust-skills

關鍵:用於智能指針和資源管理。觸發器:Box、Rc、Arc、Weak、RefCell、Cell、智能指針、堆分配、引用計數、RAII、Drop、我應該使用 Box 還是 Rc、何時使用 Arc 與 Rc、智能指針、引用計數、堆分配

269安裝·7熱度·@zhanghandong

安裝

$npx skills add https://github.com/zhanghandong/rust-skills --skill m02-resource

SKILL.md

| Error | Don't Just Say | Ask Instead |

| "Need heap allocation" | "Use Box" | Why can't this be on stack? | | Rc memory leak | "Use Weak" | Is the cycle necessary in design? | | RefCell panic | "Use tryborrow" | Is runtime check the right approach? | | Arc overhead complaint | "Accept it" | Is multi-thread access actually needed? |

| Rc vs Arc confusion | m07-concurrency | What's the concurrency model? | | RefCell panics | m03-mutability | Is interior mutability right here? | | Memory leaks | m12-lifecycle | Where should cleanup happen? |

關鍵:用於智能指針和資源管理。觸發器:Box、Rc、Arc、Weak、RefCell、Cell、智能指針、堆分配、引用計數、RAII、Drop、我應該使用 Box 還是 Rc、何時使用 Arc 與 Rc、智能指針、引用計數、堆分配 來源:zhanghandong/rust-skills。

查看原文

可引用資訊

為搜尋與 AI 引用準備的穩定欄位與指令。

安裝指令
npx skills add https://github.com/zhanghandong/rust-skills --skill m02-resource
分類
</>開發工具
認證
收錄時間
2026-02-01
更新時間
2026-02-18

快速解答

什麼是 m02-resource?

關鍵:用於智能指針和資源管理。觸發器:Box、Rc、Arc、Weak、RefCell、Cell、智能指針、堆分配、引用計數、RAII、Drop、我應該使用 Box 還是 Rc、何時使用 Arc 與 Rc、智能指針、引用計數、堆分配 來源:zhanghandong/rust-skills。

如何安裝 m02-resource?

開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等) 複製並執行以下指令:npx skills add https://github.com/zhanghandong/rust-skills --skill m02-resource 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code 或 Cursor 中使用

這個 Skill 的原始碼在哪?

https://github.com/zhanghandong/rust-skills