Skip to main content

CommandRunner

Trait CommandRunner 

Source
pub trait CommandRunner: Send {
    // Required methods
    fn run(
        &self,
        program: &str,
        args: &[String],
        env: &[(String, String)],
    ) -> Result<CommandOutcome>;
    fn as_any(&self) -> &dyn Any;
}
Expand description

Spawn seam: production uses ProcessRunner; tests inject a FakeRunner that records argv/env without spawning anything.

Required Methods§

Source

fn run( &self, program: &str, args: &[String], env: &[(String, String)], ) -> Result<CommandOutcome>

Source

fn as_any(&self) -> &dyn Any

Downcasting hook so tests can inspect recorded calls on a fake.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§