#stdio #tokio #temporarily #stream #standard #io #stdin

tokio-borrow-stdio

Temporarily expose standard input and output to a Tokio core

1 unstable release

Uses old Rust 2015

0.1.0 May 27, 2018

#7 in #temporarily


Used in stund

MIT license

10KB
139 lines

tokio-borrow-stdio

“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.)

Dependencies

~6MB
~93K SLoC