os_pipe

Function dup_stdin

source
pub fn dup_stdin() -> Result<PipeReader>
Expand description

Get a duplicated copy of the current process’s standard input, as a PipeReader.

Reading directly from this pipe isn’t recommended, because it’s not synchronized with std::io::stdin. PipeReader implements Into<Stdio>, so it can be passed directly to Command::stdin. This is equivalent to Stdio::inherit, though, so it’s usually not necessary unless you need a collection of different pipes.