Skip to main content

CommandRunner

Trait CommandRunner 

Source
pub trait CommandRunner {
    // Required method
    fn run(&self, command: &str, args: &[String]) -> CommandRunOutput;

    // Provided method
    fn run_with_timeout(
        &self,
        command: &str,
        args: &[String],
        timeout: Duration,
    ) -> CommandRunOutput { ... }
}

Required Methods§

Source

fn run(&self, command: &str, args: &[String]) -> CommandRunOutput

Provided Methods§

Source

fn run_with_timeout( &self, command: &str, args: &[String], timeout: Duration, ) -> CommandRunOutput

Run with an upper bound; the process is killed once timeout passes. Runners that cannot time out simply run the command.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§