Uses old Rust 2015
|0.1.5||Oct 31, 2018|
|0.1.4||Aug 15, 2018|
|0.1.3||Jun 25, 2018|
|0.1.1||Oct 12, 2017|
#370 in Asynchronous
680 downloads per month
Used in 7 crates (6 directly)
AsyncRead/AsyncWrite stdin/stdout for Tokio
Documentation - more description there
let mut core = tokio_core::reactor::Core::new()?; let stdin = tokio_stdin_stdout::stdin(0); let stdout = tokio_stdin_stdout::stdout(0); core.run(tokio_io::io::copy(stdin, stdout))?;
loop.rs- Write hello ten times
line-by-line.rs- Convert all input text to ASCII upper case, line by line. This example also demonstrates usage of tokio-codec and various modes of starting Tokio programs (multithreaded, singlethreaded).
Not much related to tokio-stdin-stdout, but there are some
async fn examples runnable by
They require nightly Rust.
- loop example as async fn v1 - The same as loop.rs above, but may be more readable.due to async fn backed by futures_await crate.
- line-by-line example as async fn v1 - The same as line-by-line.rs, but more prodecural-looking.
- loop example as async fn v3 - Another try with loop.rs, but this time using new async engine built-in in Rust itself. As it intrefaces early alpha code, it may stop working after a while.