feat: tokio stream

This commit is contained in:
2022-03-22 00:43:39 +08:00
parent 3f38ba99f7
commit 8fa4284e6c
4 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
use tokio_stream::{self as stream, StreamExt};
#[tokio::main]
async fn main() {
let mut stream = stream::iter(vec![0, 1, 2]);
while let Some(value) = stream.next().await {
println!("Got {}", value);
}
}