pub trait HookExecutor: Send + Sync {
// Required methods
fn kind(&self) -> &'static str;
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: HookPayload,
opts: &'life1 ExecutorOpts,
) -> Pin<Box<dyn Future<Output = HookOutcome> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Backend that runs a single hook invocation against a single payload.
Implementations are stateless per-call; the adapter constructs the
HookPayload and calls run once per matching event firing.
Contract:
- On success, return
HookOutcome::Allow,Mutate, orBlockas parsed from the backend’s output. - On failure (timeout, sandbox error, malformed output, output size
overrun), return
HookOutcome::Error { message }— never panic. The adapter applies the spec’son_errorpolicy.
Required Methods§
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: HookPayload,
opts: &'life1 ExecutorOpts,
) -> Pin<Box<dyn Future<Output = HookOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".