🎯

rust-actor

🎯Skill

from huiali/rust-skills

VibeIndex|
What it does

Enables robust concurrent programming in Rust by implementing Actor model patterns with advanced message passing, state management, and fault tolerance.

📦

Part of

huiali/rust-skills(30 items)

rust-actor

Installation

📋 No install commands found in docs. Showing default command. Check GitHub for actual instructions.
Quick InstallInstall with npx
npx skills add huiali/rust-skills --skill rust-actor
3Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

"Actor 模型专家。处理 Actor 死锁, 消息传递, 状态管理, supervision, 容错, Actix, Erlang 风格并发"

Overview

# Actor 模型

核心问题

如何在并发系统中避免死锁并实现可靠的进程间通信?

Actor 模型通过消息传递和状态隔离来简化并发。

---

Actor vs 线程模型

| 特性 | 线程模型 | Actor 模型 |

|-----|---------|-----------|

| 状态共享 | 共享内存 + 锁 | 无共享,消息传递 |

| 死锁风险 | 高(锁顺序) | 低(消息队列) |

| 扩展性 | 受限于线程数 | 可扩展到百万级 |

| 故障处理 | 手动 | Supervision 树 |

| 调试难度 | 难(竞态条件) | 相对容易(消息序列) |

---

Actor 核心结构

```rust

// Actor 基础 trait

trait Actor: Send + 'static {

type Message: Send + 'static;

type Error: std::error::Error;

fn receive(&mut self, ctx: &mut Context, msg: Self::Message);

}

// Actor 上下文

struct Context {

mailbox: Receiver,

sender: Sender,

state: ActorState,

supervisor: Option,

}

enum ActorState {

Starting,

Running,

Restarting,

Stopping,

Stopped,

}

```

---

More from this repository10

🎯
rust-skill🎯Skill

Provides expert Rust programming assistance, solving compilation errors, ownership, lifetimes, concurrency, and performance optimization challenges.

🎯
rust-skill-index🎯Skill

Indexes and provides quick navigation for 35 Rust skills across core, advanced, and expert categories.

🎯
rust-error🎯Skill

Expertly handles Rust error scenarios by providing comprehensive guidance on Result, Option, error types, propagation, and panic strategies.

🎯
rust-async🎯Skill

Handles advanced Rust async patterns like Stream processing, backpressure, select, cancellation, and concurrency management with Tokio.

🎯
rust-concurrency🎯Skill

Expertly handles Rust concurrency challenges by safely managing threads, async operations, and preventing race conditions and deadlocks.

🎯
rust-anti-pattern🎯Skill

Identifies and helps refactor Rust anti-patterns like unnecessary cloning, unwrapping, and inefficient iterations to improve code quality.

🎯
rust-web🎯Skill

Builds robust Rust web services using frameworks like axum and actix, handling routing, database interactions, and API design with type-safe, performant code.

🎯
rust-ownership🎯Skill

Skill

🎯
rust-zero-cost🎯Skill

Analyzes and optimizes Rust generic abstractions and dispatch strategies for zero-cost performance and compile-time flexibility.

🎯
rust-mutability🎯Skill

Expertly manages Rust mutability challenges, resolving borrowing conflicts and providing safe interior mutability strategies across different contexts.