2 releases

0.3.1 Mar 28, 2023
0.3.0 Mar 28, 2023
0.2.0 Aug 30, 2020
0.1.0 Jun 7, 2020

#2178 in Asynchronous

Download history 4110/week @ 2025-10-15 5641/week @ 2025-10-22 5160/week @ 2025-10-29 5177/week @ 2025-11-05 4545/week @ 2025-11-12 4424/week @ 2025-11-19 1910/week @ 2025-11-26 3846/week @ 2025-12-03 2986/week @ 2025-12-10 2005/week @ 2025-12-17 922/week @ 2025-12-24 1439/week @ 2025-12-31 2649/week @ 2026-01-07 3918/week @ 2026-01-14 4293/week @ 2026-01-21 4412/week @ 2026-01-28

15,927 downloads per month
Used in 4 crates (2 directly)

MIT license

5KB

Async-Stdin

github crates.io docs.rs build status

Read from stdin over a Tokio channel

This is useful for interactive programs that read from stdin while waiting for other events to occur.

Usage

Add this to your Cargo.toml:

[dependencies]
async-stdin = "0.3.1"

You can read from stdin like so:

use async_stdin::recv_from_stdin;

#[tokio::main]
async fn main() {
    let mut rx = recv_from_stdin(10);
    while let Some(s) = rx.recv().await {
        println!("Received: {}", s);
    }
}

Dependencies

~1.8–2.5MB
~35K SLoC