Registry / async / async-stream

async-stream

JSON →
library0.3.6rscratesunverified

Provides a convenient way to create asynchronous streams using async/await notation.

# Cargo.toml [dependencies] async-stream = "0.3.6"
INSTALL
IMPORT
SIG · ASYNC-STREAM
A
async-stream
asyncrustv0.3.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

stream
use async_stream::stream;

Creates an async stream that yields values 1, 2, and 3.

use async_stream::stream; let s = stream! { yield 1; yield 2; yield 3; }; use futures::StreamExt; let results: Vec<i32> = s.collect().await;
Debug
Known issues
gotchaRequires an async runtime (e.g., tokio) to execute the stream.
fix
Add tokio as a dependency and use #[tokio::main] or similar.
affects: >=0.3.0
Upgrade
Version history
0.3.6latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
52 hits · last 30 days
node
44
OpenAI (training)
1
Resources
async-stream — cargo add async-stream · libregistry