tokio-stream

Utilities for working with async streams (futures::Stream) in Tokio. Provides StreamExt trait for async-iterator-like operations (map, filter, take, collect, throttle, timeout), stream adapters (wrappers for channels, intervals, timeouts), and conversion utilities. The async equivalent of Rust's Iterator trait for Tokio-based applications.

Evaluated Mar 06, 2026 (0d ago) v0.1+
Homepage ↗ Repo ↗ Developer Tools rust async streams tokio futures iterator reactive
⚙ Agent Friendliness
68
/ 100
Can an agent use this?
🔒 Security
97
/ 100
Is it safe for agents?
⚡ Reliability
87
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
85
Error Messages
82
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
92
Secret Handling
92

Pure Rust async library — no network access. Memory-safe by Rust's ownership system.

⚡ Reliability

Uptime/SLA
92
Version Stability
85
Breaking Changes
82
Error Recovery
88
AF Security Reliability

Best When

Working with async streams in Tokio applications and needing map/filter/throttle/timeout on async iterators.

Avoid When

You're not using Tokio or need complex reactive operators beyond map/filter/fold.

Use Cases

  • Process Tokio mpsc or broadcast channel receivers as async streams with StreamExt combinators
  • Implement per-stream rate limiting with throttle() or timeout handling with tokio_stream::StreamExt::timeout()
  • Convert any Iterator into an async Stream using tokio_stream::iter() for compatibility with async consumers
  • Build reactive data processing pipelines using async stream combinators (map, filter, flat_map, take_while)
  • Handle Server-Sent Events (SSE) or gRPC streaming responses as async streams in Axum/tonic services

Not For

  • Synchronous iteration — use Rust's standard Iterator for non-async code
  • Complex reactive programming patterns — async-stream or reactive-futures libraries offer more advanced operators
  • Non-tokio async runtimes — tokio-stream is optimized for Tokio; use async-std streams for async-std runtime

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Library — no auth needed.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT licensed as part of the Tokio project.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Must use StreamExt from tokio_stream (not futures::StreamExt) to get tokio-specific combinators like timeout and throttle
  • Streams are lazy — nothing executes until polled with while let Some(x) = stream.next().await or collect::<Vec<_>>().await
  • timeout() wraps each item with Result<Item, Elapsed> — the outer stream never errors, individual items may be Err(Elapsed)
  • tokio-stream's wrappers for channels (ReceiverStream) require feature flags — enable 'sync' feature for channel stream wrappers
  • Streams implement Unpin or require Box::pin — moving a non-Unpin stream after creation will fail to compile; use Box::pin(stream) if ownership transfer is needed
  • StreamExt::collect() requires specifying the collection type: stream.collect::<Vec<_>>().await — type inference often fails without explicit annotation

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for tokio-stream.

$99

Scores are editorial opinions as of 2026-03-06.

5220
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered