pub struct RunningProcess { /* private fields */ }
Expand description
Manage a running child process and capture its output.
This is created by TimeoutCommand::spawn
.
Implementations§
Source§impl RunningProcess
impl RunningProcess
Sourcepub fn stdout(&self) -> &LineReceiver
pub fn stdout(&self) -> &LineReceiver
Return a LineReceiver
that returns lines from the
sub-process standard output.
Sourcepub fn stderr(&self) -> &LineReceiver
pub fn stderr(&self) -> &LineReceiver
Return a LineReceiver
that returns lines from the
sub-process standard error output.
Sourcepub fn kill(&self) -> Result<(), TimeoutError>
pub fn kill(&self) -> Result<(), TimeoutError>
Terminate sub-process with extreme prejudice.
Sourcepub fn wait(self) -> Result<TimeoutResult, TimeoutError>
pub fn wait(self) -> Result<TimeoutResult, TimeoutError>
Wait for child process to terminate. It may terminate because
it ends normally, or because it has run for longer than the
limit set with TimeoutCommand::new
. The return value of
this method will specify why, see
TimeoutResult::timed_out
.
Note that if the sub-process produces a lot of output, you
must read it to avoid the process getting stuck; see
RunningProcess::stdout
and RunningProcess::stderr
. If
you don’t read the output, the sub-process will fill its
output pipe buffer, or the inter-thread communication channel
buffer, and the sub-process will block on output, and not
progress. This may be unwanted. The blocking won’t affect the
sub-process getting terminated due to running for too long.