一键导入
ownership
Guide for Rust ownership, borrowing, and lifetimes. Use when working with ownership rules, move semantics, borrowing, slices, or lifetime annotations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide for Rust ownership, borrowing, and lifetimes. Use when working with ownership rules, move semantics, borrowing, slices, or lifetime annotations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | ownership |
| description | Guide for Rust ownership, borrowing, and lifetimes. Use when working with ownership rules, move semantics, borrowing, slices, or lifetime annotations. |
Ownership rules, borrowing, slices, and lifetimes.
Activate when:
For ownership rules, borrowing patterns, slices, and lifetime annotations, see references/ownership.md.
This skill follows core:anti-fabrication. Every claim about ownership, borrowing, and
lifetime rules is verified against the official Rust Book chapters cited in sources.md —
not inferred from generic familiarity with the language. Before asserting borrow-checker
behavior this skill and its references do not cover, check the installed Rust toolchain's
documentation rather than guessing.
Identify and refactor Rust anti-patterns and clippy anti-idioms. Use when reviewing Rust code for smells, hunting anti-patterns to fix or remove, or refactoring code that clones to satisfy the borrow checker, takes &String/&Vec parameters, unwraps on fallible paths, or returns sentinel values instead of Option/Result.
Guide for async and concurrent Rust programming. Use when writing async functions, using tokio, spawning threads, working with channels, or sharing state with Arc/Mutex.
Guide for building Rust command-line applications. Use when parsing CLI arguments with clap, adding progress bars or verbosity flags, testing a CLI binary as a subprocess, choosing process exit codes, or reporting errors to end users with anyhow context.
Guide for Rust error handling. Use when working with Result, Option, the ? operator, implementing custom error types, or composing errors with thiserror and anyhow.
Guide for Rust programming language. Use when writing Rust code, setting up Rust projects, or needing an overview of Rust development workflows.
Guide for Rust testing and Cargo usage. Use when writing unit or integration tests, configuring Cargo.toml, or running cargo commands.