Skip to main content

ProcessControl

Trait ProcessControl 

Source
pub trait ProcessControl: Send {
    // Required methods
    fn pid(&self) -> Option<u32>;
    fn kill_tree(&self);
    fn wait(&mut self) -> BoxFuture<'_, Result<ExitStatus>>;
    fn close_output(&mut self);
}
Expand description

Control half of a running process.

Required Methods§

Source

fn pid(&self) -> Option<u32>

OS process id, when known.

Source

fn kill_tree(&self)

Kills the process and all its descendants (killProcessTree: killpg(SIGKILL) on Unix, taskkill /F /T on Windows). Never fails; a dead process is ignored.

Source

fn wait(&mut self) -> BoxFuture<'_, Result<ExitStatus>>

Waits for the process to exit. Cancel-safe.

Source

fn close_output(&mut self)

Stops reading output (pipes inherited by detached descendants may never close).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§