Skip to main content

ProcessHandle

Trait ProcessHandle 

Source
pub trait ProcessHandle: Send {
    // Required methods
    fn output(
        &mut self,
    ) -> Option<BoxStream<'static, Result<OutputChunk, ExecError>>>;
    fn kill(&mut self) -> BoxFuture<'_, ()>;
    fn wait(&mut self) -> BoxFuture<'_, Result<ExitStatus, ExecError>>;
}
Expand description

A process that has started.

Required Methods§

Source

fn output( &mut self, ) -> Option<BoxStream<'static, Result<OutputChunk, ExecError>>>

The output, incrementally. None after the first call — the stream owns the pipes.

Streaming is a requirement, not an optimization. A long-running command’s output reaches the user while it runs; a provider that returned everything at the end would remove that silently.

Source

fn kill(&mut self) -> BoxFuture<'_, ()>

Stop it and whatever it started that is still running. Best effort, and idempotent; also valid after wait, for the descendants that outlived it.

Source

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

Wait for it to finish.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§