logo
pub struct ChildStdout(_);
Available on unstable only.
Expand description

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

When a ChildStdout is dropped, the underlying handle gets closed.

Implementations

Convert async_process::ChildStdout into std::process::Stdio.

You can use it to associate to the next process.

Examples
use async_process::Command;
use std::process::Stdio;
use std::io::Read;
use futures_lite::AsyncReadExt;

let mut ls_child = Command::new("ls").stdout(Stdio::piped()).spawn()?;
let stdio:Stdio = ls_child.stdout.take().unwrap().into_stdio().await?;

let mut echo_child = Command::new("echo").stdin(stdio).stdout(Stdio::piped()).spawn()?;
let mut buf = vec![];
echo_child.stdout.take().unwrap().read(&mut buf).await;

Trait Implementations

Attempt to read from the AsyncRead into buf. Read more

Attempt to read from the AsyncRead into bufs using vectored IO operations. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Reads some bytes from the byte stream. Read more

Like read(), except it reads into a slice of buffers. Read more

Reads the entire contents and appends them to a Vec. Read more

Reads the entire contents and appends them to a String. Read more

Reads the exact number of bytes required to fill buf. Read more

Creates an adapter which will read at most limit bytes from it. Read more

Converts this AsyncRead into a Stream of bytes. Read more

Creates an adapter which will chain this stream with another. Read more

Boxes the reader and changes its type to dyn AsyncRead + Send + 'a. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.