Struct async_process::ChildStdout[][src]

pub struct ChildStdout(_);

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

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

Implementations

impl ChildStdout[src]

pub async fn into_stdio(self) -> Result<Stdio>[src]

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

impl AsyncRead for ChildStdout[src]

impl Debug for ChildStdout[src]

Auto Trait Implementations

Blanket Implementations

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

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?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.