1.0.0[][src]Struct std::process::ChildStderr

pub struct ChildStderr { /* fields omitted */ }

A handle to a child process's stderr.

This struct is used in the stderr field on Child.

When an instance of ChildStderr is dropped, the ChildStderr's underlying file handle will be closed.

Trait Implementations

impl AsRawFd for ChildStderr1.2.0[src]

This is supported on Unix only.

impl AsRawHandle for ChildStderr1.2.0[src]

This is supported on Windows only.

impl Debug for ChildStderr1.16.0[src]

impl From<ChildStderr> for Stdio1.20.0[src]

pub fn from(child: ChildStderr) -> Stdio[src]

Converts a ChildStderr into a 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()) // Converted into a Stdio here
    .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

impl IntoRawFd for ChildStderr1.4.0[src]

This is supported on Unix only.

impl IntoRawHandle for ChildStderr1.4.0[src]

This is supported on Windows only.

impl Read for ChildStderr[src]

Auto Trait Implementations

impl RefUnwindSafe for ChildStderr[src]

impl Send for ChildStderr[src]

impl Sync for ChildStderr[src]

impl Unpin for ChildStderr[src]

impl UnwindSafe for ChildStderr[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.