Stdio::makes_pipe by ChrisDenton · Pull Request #97150 · rust-lang/rust (original) (raw)

Wrappers around std::process::Command may want to be able to override pipe creation. However, std::process::Stdio is opaque so there's no way to tell if Command was told to create new pipes or not.

This is in some ways a more generic (and cross-platform) alternative to #97149. However, unlike that feature, this comes with the price of the user needing to actually create their own pipes rather than reusing the std one. So I think it stands (or not) on its own.

Example

#![feature(stdio_makes_pipe)] use std::process::Stdio;

let io = Stdio::piped(); assert_eq!(io.makes_pipe(), true);