Skip to main content

CommandRunner

Trait CommandRunner 

Source
pub trait CommandRunner: Send + Sync {
    // Required methods
    fn run_command<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        cmd: &'life1 str,
        args: &'life2 [String],
    ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn run_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        cmd: &'life1 str,
        args: &'life2 [String],
        context: &'life3 ExecutionContext,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;

    // Provided method
    fn run_with_streaming<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        cmd: &'life1 str,
        args: &'life2 [String],
        context: &'life3 ExecutionContext,
        _output_handler: Box<dyn StreamProcessor>,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
}
Expand description

Trait for running system commands

Required Methods§

Source

fn run_command<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, cmd: &'life1 str, args: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Run a command and return output

Source

fn run_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, cmd: &'life1 str, args: &'life2 [String], context: &'life3 ExecutionContext, ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Run a command with full control

Provided Methods§

Source

fn run_with_streaming<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, cmd: &'life1 str, args: &'life2 [String], context: &'life3 ExecutionContext, _output_handler: Box<dyn StreamProcessor>, ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Run a command with streaming output processing Default implementation falls back to buffered execution

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§