Skip to main content

ProcessExec

Trait ProcessExec 

Source
pub trait ProcessExec {
    // Required method
    fn exec(
        &self,
        cmd: &str,
        args: &[String],
        stdin: Option<&str>,
    ) -> Result<ProcessResult, Error>;
}
Expand description

Abstraction over process spawning, allowing test mocks.

Required Methods§

Source

fn exec( &self, cmd: &str, args: &[String], stdin: Option<&str>, ) -> Result<ProcessResult, Error>

Execute cmd with args, optionally piping stdin to the process.

Returns ProcessResult even on non-zero exit — the runner decides whether a non-zero status is an error.

Implementors§