Maverick Rust Async

Rust async/await with Tokio and async patterns Use when this capability is needed.

tomevault-io 03edb5a 2 files · 1.6 KB Updated

File contents

Rust Async Skill

Tokio Basics

#[tokio::main]
async fn main() {
    let result = fetch_data().await;
}

async fn fetch_data() -> Result<String, Error> {
    // async operation
}

Spawning Tasks

let handle = tokio::spawn(async move {
    expensive_operation().await
});

let result = handle.await?;

Send + Sync Bounds

  • Send: Can transfer across thread boundaries
  • Sync: Can be shared across threads (&T is Send)
  • Use Arc instead of Rc for thread-safe reference counting

Review Severity

  • CRITICAL: Blocking calls in async functions
  • MAJOR: Using Rc in async code (not Send)
  • MINOR: Not using async context managers

Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/get2knowio--maverick--maverick-rust-async commit 03edb5ae27

Frequently asked questions

npx skillmds@latest add tomevault-io/maverick-rust-async