Struct std::process::ChildStderr 1.0.0[−][src]
pub struct ChildStderr { /* fields omitted */ }
Expand description
Trait Implementations
This is supported on Unix only.
This is supported on Windows only.
提取原始句柄,无需任何所有权。
将 ChildStderr
转换为 Stdio
Examples
use std::process::{Command, Stdio}; let reverse = Command::new("rev") .arg("non_existing_file.txt") .stderr(Stdio::piped()) .spawn() .expect("failed reverse command"); let cat = Command::new("cat") .arg("-") .stdin(reverse.stderr.unwrap()) // 在此处转换为 Stdio .output() .expect("failed echo command"); assert_eq!( String::from_utf8_lossy(&cat.stdout), "rev: cannot open non_existing_file.txt: No such file or directory\n" );Run