os_pipe

Function dup_stdout

source
pub fn dup_stdout() -> Result<PipeWriter>
Expand description

Get a duplicated copy of the current process’s standard output, as a PipeWriter.

Writing directly to this pipe isn’t recommended, because it’s not synchronized with std::io::stdout. PipeWriter implements Into<Stdio>, so it can be passed directly to Command::stdout or Command::stderr. This can be useful if you want the child’s stderr to go to the parent’s stdout.