pub trait RunnerProcess {
    // Required methods
    fn try_wait(&mut self) -> Result<Option<ExitStatus>>;
    fn wait(&mut self, timeout: Duration) -> Result<ExitStatus>;
    fn running(&mut self) -> bool;
    fn kill(&mut self) -> Result<ExitStatus>;
}

Required Methods§

source

fn try_wait(&mut self) -> Result<Option<ExitStatus>>

Attempts to collect the exit status of the process if it has already exited.

This function will not block the calling thread and will only advisorily check to see if the child process has exited or not. If the process has exited then on Unix the process ID is reaped. This function is guaranteed to repeatedly return a successful exit status so long as the child has already exited.

If the process has exited, then Ok(Some(status)) is returned. If the exit status is not available at this time then Ok(None) is returned. If an error occurs, then that error is returned.

source

fn wait(&mut self, timeout: Duration) -> Result<ExitStatus>

Waits for the process to exit completely, killing it if it does not stop within timeout, and returns the status that it exited with.

Firefox’ integrated background monitor observes long running threads during shutdown and kills these after 63 seconds. If the process fails to exit within the duration of timeout, it is forcefully killed.

This function will continue to have the same return value after it has been called at least once.

source

fn running(&mut self) -> bool

Determine if the process is still running.

source

fn kill(&mut self) -> Result<ExitStatus>

Forces the process to exit and returns the exit status. This is equivalent to sending a SIGKILL on Unix platforms.

Implementors§