pub fn output(mut self) -> impl Future<Output = io::Result<Output>> {
        // A future that waits for the exit status.
        let status = self.status();

        // A future that collects stdout.
        let stdout = self.stdout.take();
        let stdout = async move {
            let mut v = Vec::new();
            if let Some(mut s) = stdout {
                s.read_to_end(&mut v).await?;
            }
            io::Result::Ok(v)
        };

        // A future that collects stderr.
        let stderr = self.stderr.take();
        let stderr = async move {
            let mut v = Vec::new();
            if let Some(mut s) = stderr {
                s.read_to_end(&mut v).await?;
            }
            io::Result::Ok(v)
        };

        async move {
            let (stdout, stderr) = future::try_join(stdout, stderr).await?;
            let status = status.await?;
            Ok(Output {
                status,
                stdout,
                stderr,
            })
        }
    }
/// Drops the stdin handle and collects the output of the process.
///
/// Closing the stdin of the process helps avoid deadlocks. It ensures that the process does
/// not block waiting for input from the parent process while the parent waits for the child to
/// exit.
///
/// In order to capture the output of the process, [`Command::stdout()`] and
/// [`Command::stderr()`] must be configured with [`Stdio::piped()`].
///
/// # Examples
///
/// ```no_run
/// # futures::executor::block_on(async {
/// use superpoll_process::{Command, Stdio};
///
/// let child = Command::new("ls")
///     .stdout(Stdio::piped())
///     .stderr(Stdio::piped())
///     .spawn()?;
///
/// let out = child.output().await?;
/// # std::io::Result::Ok(()) });
/// ```
Drops the stdin handle and collects the output of the process.
Closing the stdin of the process helps avoid deadlocks. It ensures that the process does
not block waiting for input from the parent process while the parent waits for the child to
exit.


Drops the stdin handle and collects the output of the process . Closing the stdin of the process helps avoid deadlocks . It ensures that the process does not block waiting for input from the parent process while the parent waits for the child to exit .
pub fn output(mut self) -> impl Future<Output = io::Result<Output>> {
        // A future that waits for the exit status.
        let status = self.status();
        // A future that collects stdout.
        let stdout = self.stdout.take();
        let stdout = async move {
            let mut v = Vec::new();
            if let Some(mut s) = stdout {
                s.read_to_end(&mut v).await?;
            }
            io::Result::Ok(v)
        };
        // A future that collects stderr.
        let stderr = self.stderr.take();
        let stderr = async move {
            let mut v = Vec::new();
            if let Some(mut s) = stderr {
                s.read_to_end(&mut v).await?;
            }
            io::Result::Ok(v)
        };
        async move {
            let (stdout, stderr) = future::try_join(stdout, stderr).await?;
            let status = status.await?;
            Ok(Output {
                status,
                stdout,
                stderr,
            })
        }
    }
pub fn output ( mut self ) -> impl Future < Output = io :: Result < Output > > { // A future that waits for the exit status. let status = self . status ( ) ; // A future that collects stdout. let stdout = self . stdout . take ( ) ; let stdout = async move { let mut v = Vec :: new ( ) ; if let Some ( mut s ) = stdout { s . read_to_end ( & mut v ) . await ? ; } io :: Result :: Ok ( v ) } ; // A future that collects stderr. let stderr = self . stderr . take ( ) ; let stderr = async move { let mut v = Vec :: new ( ) ; if let Some ( mut s ) = stderr { s . read_to_end ( & mut v ) . await ? ; } io :: Result :: Ok ( v ) } ; async move { let ( stdout , stderr ) = future :: try_join ( stdout , stderr ) . await ? ; let status = status . await ? ; Ok ( Output { status , stdout , stderr , } ) } }
Drops the stdin handle and collects the output of the process.
Drops the stdin handle and collects the output of the process .
mut self
mut self
examples
None
futures::executor::block_on(async {
use superpoll_process::{Command, Stdio}.

let child = Command::new("ls")
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()?.

let out = child.output().await?.
use superpoll_process :: { Command Stdio } . let child = Command :: new ( " ls " ) . stdout ( Stdio :: piped () ) . stderr ( Stdio :: piped () ) . spawn () ? . let out = child . output () . await? .
std::io::result::ok(()) });
None