Struct std::process::ChildStdout 1.0.0[−][src]
pub struct ChildStdout { /* fields omitted */ }
Expand description
Trait Implementations
This is supported on Unix only.
This is supported on Windows only.
提取原始句柄,无需任何所有权。
将 ChildStdout
转换为 Stdio
Examples
ChildStdout
将在引擎盖下使用 Stdio::from
转换为 Stdio
。
use std::process::{Command, Stdio}; let hello = Command::new("echo") .arg("Hello, world!") .stdout(Stdio::piped()) .spawn() .expect("failed echo command"); let reverse = Command::new("rev") .stdin(hello.stdout.unwrap()) // 在此处转换为 Stdio .output() .expect("failed reverse command"); assert_eq!(reverse.stdout, b"!dlrow ,olleH\n");Run