Struct std::process::ChildStdout 1.0.0[−][src]
pub struct ChildStdout { /* fields omitted */ }
Expand description
Trait Implementations
提取原始句柄,无需任何所有权。
执行转换。
执行转换。
将 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消费这个对象,返回原始的底层文件描述符。 Read more
消耗此对象,返回原始底层句柄。 Read more
与 read
相似,不同之处在于它读入缓冲区的一部分。 Read more
读取所有字节,直到此源中的 EOF 为止,然后将它们放入 buf
。 Read more
读取这个源中的所有字节,直到 EOF 为止,然后将它们追加到 buf
。 Read more
为这个 Read
实例创建一个 “by reference” 适配器。 Read more
创建一个适配器,将这个流与另一个链接起来。 Read more