Skip to main content

SdkHookForwarder

Trait SdkHookForwarder 

Source
pub trait SdkHookForwarder: Send + Sync {
    // Required method
    fn forward<'life0, 'life1, 'async_trait>(
        &'life0 self,
        input: &'life1 HookInput,
    ) -> Pin<Box<dyn Future<Output = Option<HookResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Discovers and runs external hook executables.

External hooks are scanned from one or more directories. Each executable file is treated as a hook. When dispatch is called, the runner sends the event to each hook in order and returns the first non-Continue decision. Hooks that timeout or return invalid output are treated as Continue (fail-open). Forwards a lifecycle hook to a Claude-compatible host via control_request / hook_callback. Implemented by the CLI control bridge.

Required Methods§

Source

fn forward<'life0, 'life1, 'async_trait>( &'life0 self, input: &'life1 HookInput, ) -> Pin<Box<dyn Future<Output = Option<HookResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Ask the host to run registered SDK callbacks for this event. Return None to fall through to local external hooks.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§