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

pub struct ChildStdout { /* fields omitted */ }

A handle to a child process's standard output (stdout).

This struct is used in the stdout field on Child.

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

Trait Implementations

impl Read for ChildStdout[src]

impl AsRawHandle for ChildStdout1.2.0[src]

impl IntoRawHandle for ChildStdout1.4.0[src]

impl AsRawFd for ChildStdout1.2.0[src]

impl IntoRawFd for ChildStdout1.4.0[src]

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

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

Converts a ChildStdout into a Stdio

Examples

ChildStdout will be converted to Stdio using Stdio::from under the hood.

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())  // Converted into a Stdio here
    .output()
    .expect("failed reverse command");

assert_eq!(reverse.stdout, b"!dlrow ,olleH\n");Run

impl Debug for ChildStdout1.16.0[src]

Auto Trait Implementations

impl UnwindSafe for ChildStdout

impl RefUnwindSafe for ChildStdout

impl Unpin for ChildStdout

impl Send for ChildStdout

impl Sync for ChildStdout

Blanket Implementations

impl<T> From<T> for 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> Into<U> for T where
    U: From<T>, 
[src]

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.

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

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

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