Skip to main content

CommandRunner

Trait CommandRunner 

Source
pub trait CommandRunner {
    // Required methods
    fn run(
        &mut self,
        spec: &CommandSpec,
        stdin: Option<&[u8]>,
    ) -> Result<CommandOutput>;
    fn spawn_detached(&mut self, spec: &CommandSpec) -> Result<()>;
}
Expand description

Injectable process boundary used by platform services and packaging.

Required Methods§

Source

fn run( &mut self, spec: &CommandSpec, stdin: Option<&[u8]>, ) -> Result<CommandOutput>

Run a command with optional stdin and capture its output.

§Errors

Returns process creation, stdin, wait, or capture failures.

Source

fn spawn_detached(&mut self, spec: &CommandSpec) -> Result<()>

Spawn a detached command with all standard streams disconnected.

§Errors

Returns process creation failures.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§