pub fn status(&mut self) -> impl Future<Output = io::Result<ExitStatus>> {
        self.stdin.take();
        let child = self.child.clone();

        async move {
            let mut listener = None;
            loop {
                if let Some(status) = child.lock().unwrap().get_mut().try_wait()? {
                    return Ok(status);
                }
                match listener.take() {
                    None => listener = Some(SIGCHLD.listen()),
                    Some(listener) => listener.await,
                }
            }
        }
    }
/// Drops the stdin handle and waits for the process to exit.
///
/// 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.
///
/// # Examples
///
/// ```no_run
/// # futures::executor::block_on(async {
/// use superpoll_process::{Command, Stdio};
///
/// let mut child = Command::new("cp")
///     .arg("a.txt")
///     .arg("b.txt")
///     .spawn()?;
///
/// println!("exit status: {}", child.status().await?);
/// # std::io::Result::Ok(()) });
/// ```
Drops the stdin handle and waits for the process to exit.
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 waits for the process to exit . 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 status(&mut self) -> impl Future<Output = io::Result<ExitStatus>> {
        self.stdin.take();
        let child = self.child.clone();
        async move {
            let mut listener = None;
            loop {
                if let Some(status) = child.lock().unwrap().get_mut().try_wait()? {
                    return Ok(status);
                }
                match listener.take() {
                    None => listener = Some(SIGCHLD.listen()),
                    Some(listener) => listener.await,
                }
            }
        }
    }
pub fn status ( & mut self ) -> impl Future < Output = io :: Result < ExitStatus > > { self . stdin . take ( ) ; let child = self . child . clone ( ) ; async move { let mut listener = None ; loop { if let Some ( status ) = child . lock ( ) . unwrap ( ) . get_mut ( ) . try_wait ( ) ? { return Ok ( status ) ; } match listener . take ( ) { None => listener = Some ( SIGCHLD . listen ( ) ) , Some ( listener ) => listener . await , } } } }
Drops the stdin handle and waits for the process to exit.
Drops the stdin handle and waits for the process to exit .
&mut self
&mut self
examples
None
futures::executor::block_on(async {
use superpoll_process::{Command, Stdio}.



println!("exit status: {}", child.status().await?).
use superpoll_process :: { Command Stdio } . println! ( " exit status : {} " child . status () . await? ) .
std::io::result::ok(()) });
None