Skip to main content

CommandRunner

Trait CommandRunner 

Source
pub trait CommandRunner: Send + Sync {
    // Required methods
    fn run<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        cmd: &'life1 Cmd,
        stdout: &'life2 mut (dyn Write + Send),
        stderr: &'life3 mut (dyn Write + Send),
    ) -> Pin<Box<dyn Future<Output = Result<Exit, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn output<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cmd: &'life1 Cmd,
    ) -> Pin<Box<dyn Future<Output = Result<CmdOutput, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Starts processes. Err is the text of the error from starting the child (the lookup failure for a failed lookup, else the spawn failure); a started child that fails is an Ok Exit.

Required Methods§

Source

fn run<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, cmd: &'life1 Cmd, stdout: &'life2 mut (dyn Write + Send), stderr: &'life3 mut (dyn Write + Send), ) -> Pin<Box<dyn Future<Output = Result<Exit, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Runs cmd to completion with stdin from the null device, copying its output to stdout and stderr as it arrives.

Source

fn output<'life0, 'life1, 'async_trait>( &'life0 self, cmd: &'life1 Cmd, ) -> Pin<Box<dyn Future<Output = Result<CmdOutput, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Runs cmd to completion with stdin from the null device and captures its output.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§