Struct std::process::ChildStderr1.0.0[][src]

pub struct ChildStderr { /* fields omitted */ }
Expand description

子进程的 stderr 的句柄。

该结构体用于 Childstderr 字段中。

ChildStderr 的实例被 丢弃 时,ChildStderr 的底层文件句柄将关闭。

Trait Implementations

🔬 This is a nightly-only experimental API. (io_safety #87074)

借用文件描述符。 Read more

🔬 This is a nightly-only experimental API. (io_safety #87074)

借用句柄。 Read more

提取原始文件描述符。 Read more

提取原始句柄,无需任何所有权。

使用给定的格式化程序格式化该值。 Read more

执行转换。

执行转换。

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

消费这个对象,返回原始的底层文件描述符。 Read more

消耗此对象,返回原始底层句柄。 Read more

从该源中提取一些字节到指定的缓冲区中,返回读取的字节数。 Read more

read 相似,不同之处在于它读入缓冲区的一部分。 Read more

🔬 This is a nightly-only experimental API. (can_vector #69941)

确定此 Read 是否具有有效的 read_vectored 实现。 Read more

读取所有字节,直到此源中的 EOF 为止,然后将它们放入 bufRead more

读取这个源中的所有字节,直到 EOF 为止,然后将它们追加到 bufRead more

读取填充 buf 所需的确切字节数。 Read more

🔬 This is a nightly-only experimental API. (read_buf #78485)

从此源中提取一些字节到指定的缓冲区中。 Read more

🔬 This is a nightly-only experimental API. (read_buf #78485)

读取填充 buf 所需的确切字节数。 Read more

为这个 Read 实例创建一个 “by reference” 适配器。 Read more

将此 Read 实例的字节数转换为 IteratorRead more

创建一个适配器,将这个流与另一个链接起来。 Read more

创建一个适配器,最多从中读取 limit 个字节。 Read more

Auto Trait Implementations

Blanket Implementations

获取 selfTypeIdRead more

从拥有的值中一成不变地借用。 Read more

从拥有的值中借用。 Read more

执行转换。

执行转换。

发生转换错误时返回的类型。

执行转换。

发生转换错误时返回的类型。

执行转换。