skills/smithery.ai/rust-linear-type

rust-linear-type

Installation
SKILL.md

线性类型 vs Rust 所有权

特性 Rust 所有权 线性类型
移动语义 ✓ ✓
复制语义 可选 ✗
析构保证 Drop Destructible
借用 ✓ ✗ 或受限
多重所有 Rc/Arc ✗

Rust 默认不是线性类型,但可以通过模式实现线性语义。

Destructible Trait

// 线性类型的核心:Destructible 保证析构
use std::mem::ManuallyDrop;
Installs
1
First Seen
Apr 6, 2026