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>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: '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§
Sourcefn 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>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
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>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Execute a command.