interactive_process
A tiny Rust library for interacting with a running process over stdio
.
A common pattern in Unix is to have programs that either produce or consume
newline-delimited text over standard input and output (stdio
) streams.
This crate provides a light wrapper (really light, look at src/lib.rs)
that provides a tidy little abstraction for this pattern on top of Rust's
built-in std::process
. Besides std
, this crate has no dependencies.
Usage
The examples in examples/ are instructive. For example, here's
echo_stream.rs
:
use InteractiveProcess;
use ;
Limitations
I've tested this for simple things on Linux, but it's not battle-tested and I haven't tested it on other platforms. If you encounter issues, please open an issue and I'll do my best to work through it with you.