HookExecutor

Trait HookExecutor 

Source
pub trait HookExecutor: Send + Sync {
    // Required method
    fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        program: &'life1 str,
        args: &'life2 [String],
        cwd: Option<&'life3 Path>,
        max_output_bytes: usize,
    ) -> Pin<Box<dyn Future<Output = Result<HookOutput, AppError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
}
Expand description

A hook executor.

This trait exists to make the hook engine testable without spawning real processes (though we do use process execution in unit tests on Unix).

Required Methods§

Source

fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, program: &'life1 str, args: &'life2 [String], cwd: Option<&'life3 Path>, max_output_bytes: usize, ) -> Pin<Box<dyn Future<Output = Result<HookOutput, AppError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Execute a command.

Implementors§