pub trait ProcessRunner {
// Required method
fn run(
&self,
program: &str,
args: &[&str],
env: &[(&str, &str)],
stdio: StdioMode,
) -> Result<CommandOutput>;
// Provided method
fn run_with_stdin(
&self,
program: &str,
args: &[&str],
env: &[(&str, &str)],
stdin: &[u8],
) -> Result<CommandOutput> { ... }
}Expand description
Runs external programs (real OS or a test double).
Required Methods§
Provided Methods§
Sourcefn run_with_stdin(
&self,
program: &str,
args: &[&str],
env: &[(&str, &str)],
stdin: &[u8],
) -> Result<CommandOutput>
fn run_with_stdin( &self, program: &str, args: &[&str], env: &[(&str, &str)], stdin: &[u8], ) -> Result<CommandOutput>
Like Self::run with StdioMode::Capture, writing stdin to the child.
Default: unsupported (test doubles that never feed stdin can keep the default).
§Errors
Returns crate::HortoError when spawn/write fails or the runner rejects stdin.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".