Crates.io | tokio-borrow-stdio |
lib.rs | tokio-borrow-stdio |
version | 0.1.0 |
source | src |
created_at | 2018-05-27 22:14:00.282391 |
updated_at | 2018-05-27 22:14:00.282391 |
description | Temporarily expose standard input and output to a Tokio core. |
homepage | https://github.com/pkgw/stund/tree/master/tokio-borrow-stdio |
repository | https://github.com/pkgw/stund/ |
max_upload_size | |
id | 67354 |
size | 9,984 |
“Borrow” the standard input/output streams temporarily, exposing them to a Tokio core as nonblocking streams.
There are several crates implementing this general class of functionality:
Why yet another one? The key is in the name — this is the only crate that temporarily takes over stdin/stdout. This makes it possible for the stund CLI client to temporarily start up an asynchronous Tokio core when necessary, but otherwise use traditional blocking I/O for most of its user interactions.
This crate only works on Unix-like operating systems. (The program for which it was developed, stund, uses things like pseudo-TTYs and Unix domain sockets, so there is no expectation of ever porting it to other kinds of OS.)