Trait xscript::Run

source ·
pub trait Run<S: CmdString> {
    // Required method
    fn run(&self, cmd: Cmd<S>) -> Result<RunOutput, RunError<S>>;

    // Provided methods
    fn read_str(&self, cmd: Cmd<S>) -> Result<String, RunError<S>> { ... }
    fn read_bytes(&self, cmd: Cmd<S>) -> Result<Vec<u8>, RunError<S>> { ... }
}
Expand description

Trait for running commands in an execution environment.

Required Methods§

source

fn run(&self, cmd: Cmd<S>) -> Result<RunOutput, RunError<S>>

Runs a command returning its output.

Provided Methods§

source

fn read_str(&self, cmd: Cmd<S>) -> Result<String, RunError<S>>

Runs a command returning its stdout output as a string.

source

fn read_bytes(&self, cmd: Cmd<S>) -> Result<Vec<u8>, RunError<S>>

Runs a command returning its stderr output as a string.

Implementors§