| Crates.io | async-stream-lite |
| lib.rs | async-stream-lite |
| version | 0.2.0 |
| created_at | 2024-11-16 22:18:21.111738+00 |
| updated_at | 2024-12-04 06:35:26.485397+00 |
| description | Proc macro-free async/await Rust streams |
| homepage | |
| repository | https://github.com/pykeio/async-stream-lite |
| max_upload_size | |
| id | 1450710 |
| size | 24,707 |
async-stream-liteIt's async-stream, but without proc macros.
use async_stream_lite::async_stream;
use futures_util::{pin_mut, stream::StreamExt};
#[tokio::main]
async fn main() {
let stream = async_stream(|yielder| async move {
for i in 0..3 {
yielder.r#yield(i).await;
}
});
pin_mut!(stream);
while let Some(value) = stream.next().await {
println!("got {}", value);
}
}
#![no_std] supportasync-stream-lite supports #![no_std], but requires alloc.