async-stdin 0.3.1

Asynchronously read from stdin
Documentation
1
2
3
4
5
6
7
8
9
10
11
use async_stdin::recv_from_stdin;

// Run with `cargo run --example echo`
// Then start sending input to stdin to see it echoed back
#[tokio::main]
async fn main() {
    let mut rx = recv_from_stdin(10);
    while let Some(s) = rx.recv().await {
        println!("Received: {}", s);
    }
}