Tokio
- Category
- Frameworks and libraries
- Docs outline
- 14 sections
Official docs outline
tokio.rs- Hello Tokio
Async main, the #[tokio::main] macro, the runtime, and writing a first async program.
- Async in depth
How Rust futures, the Future trait, poll, wakers and executors actually work underneath async/await.
- Spawning tasks
tokio::spawn, JoinHandle, the 'static and Send requirements, and how tasks are scheduled.
- Shared state
Sharing data between tasks with Arc and Mutex, sharding locks, and avoiding holding a std Mutex across .await.
- Channels
Message passing with mpsc, oneshot, broadcast and watch channels, and the actor-style pattern.
- I/O
AsyncRead and AsyncWrite, copy, split, and reading and writing byte streams.
- Framing
Buffered reads, parsing byte streams into frames, and write buffering.
- Select
tokio::select! for waiting on multiple async operations, branch cancellation and cancel safety.
- Streams
The Stream trait, StreamExt adaptors, iteration and mini-redis style subscriptions.
- Graceful shutdown
Detecting shutdown signals, telling tasks to stop with CancellationToken or broadcast, and waiting for tasks to finish.
- Bridging with sync code
Calling async code from blocking code and blocking code from async, spawn_blocking and runtime handles.
- Unit testing
Testing async code with #[tokio::test], paused time, and mock I/O.
- Getting started with tracing
Instrumenting async applications with the tracing crate for structured, span-based diagnostics.
- Tokio API documentation
Crate-level reference for the runtime, task, sync, time, io, net and fs modules and feature flags.
Each section links to the official page. Titles and summaries by Extra Credit; the docs belong to their authors.