Skip to main content

HookExecutor

Trait HookExecutor 

Source
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, or Block as 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’s on_error policy.

Required Methods§

Source

fn kind(&self) -> &'static str

Stable backend identifier (matches ExecutorSpec tag).

Source

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".

Implementors§