Rust Pin
Pin and self-referential types expert covering Pin, Unpin, Future, async state machines, pinning projection, and memory stability guarantees.
Install
npx skills add huiali/rust-skills --skill rust-pingit clone --depth 1 https://github.com/huiali/rust-skills.git /tmp/rust-skills
mkdir -p ~/.claude/skills
cp -r /tmp/rust-skills/.codex/skills/rust-pin ~/.claude/skills/rust-pinPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
## When Pin is Needed
### 1. async/await Futures
```rust
use std::pin::Pin;
use std::task::{Context, Poll};
use std::future::Future;
struct MyFuture {
state: State,
}
impl Future for MyFuture {
type Output = ();
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
// self is pinned, guaranteed not to move
let this = self.get_mut();
Poll::Ready(())
}
}
```
### 2. Self-Referential Structures
```rust
use std::pin::Pin;
struct Node {
value: i32,
// Self-reference: pointer to field within same struct
next: Option<Pin<Box<Node>>>,
}
```
## Solution Patterns
### Pattern 1: Pinning on Heap
```rust
use std::pin::Pin;
let future = async {
// async block creates a Future
};
// Pin future on heap
let pinned: Pin<Box<dyn Future<Output = ()>>> = Box::pin(future);
// Now safe to poll
```
### Pattern 2: Pinning with Pin::new_uncheckedDetails
- Skill name
rust-pin- Repository
- huiali/rust-skills
- Path
.codex/skills/rust-pin/SKILL.md- License
- MIT
- Repo updated
- 9 February 2026
FAQ
What does the Rust Pin skill do?
Pin and self-referential types expert covering Pin, Unpin, Future, async state machines, pinning projection, and memory stability guarantees.
How do I install the Rust Pin skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add huiali/rust-skills --skill rust-pin. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Rust Pin popular?
It lives in huiali/rust-skills, which has 49 GitHub stars and 7 forks.
Related skills
Rust Actor
49huiali/rust-skills
Actor model expert covering message passing, state isolation, supervision trees, deadlock prevention, fault tolerance, Actix framework, and Erlang-style concurrency patterns.
Rust Anti Pattern
49huiali/rust-skills
Rust anti-patterns and common mistakes expert. Handles code review issues with clone abuse, unwrap in production, String misuse, index loops, and refactoring guidance.
Rust Async
49huiali/rust-skills
Advanced async patterns expert. Handles Stream processing, backpressure control, select/join operations, cancellation, Future trait implementation, and async runtime optimization.
Rust Resource
49huiali/rust-skills
智能指针与资源管理专家。处理 Box, Rc, Arc, Weak, RefCell, Cell, interior mutability, RAII, Drop, 堆分配, 引用计数, 智能指针--- # 智能指针与资源管理 ## 核心问题 **这个资源应该用什么方式管理?** 选择正确的智能指针是 Rust 编程的核心决策之一。
Rust Performance
49huiali/rust-skills
Performance optimization expert covering profiling, benchmarking, memory allocation, SIMD, cache optimization, false sharing, lock contention, and NUMA-aware programming.
Rust Skill
49huiali/rust-skills
Rust 编程专家技能。处理所有 Rust 相关问题:编译错误、所有权、生命周期、并发、async/await、性能优化等。触发词:Rust, cargo, 编译错误, ownership, borrow, lifetime, async, tokio, Send, Sync, Result, Error--- # Rust Expert Skill 我会像经验丰富的 Rust 开发者一样思考和解决问题。 ## 我的思维方式 ### 1. 安全第一 Rust 的类型系统是我的安全网。每一个 `&` 和 `mut` 都有其意义。 ### 2. 零成本抽象 高级代码不应该有运行时开销。如果有疑问,性能测试会说话。 ### 3. 所有权驱动设计 谁拥有这个数据?" 是我最先问的问题。 ### 4. 编译时检查优于运行时检查 尽可能在编译期发现问题,而不是依赖运行时检查。
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.