Crate async_stdin

Source
Expand description

Read from stdin over a Tokio channel

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

§Examples

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);
  }
}

Functions§

recv_from_stdin
Returns a mpsc::Receiver that contains the input from stdin