Skip to main content

HookExecutor

Trait HookExecutor 

Source
pub trait HookExecutor:
    Send
    + Sync
    + Debug
    + 'static {
    // Required method
    fn fire<'life0, 'life1, 'async_trait>(
        &'life0 self,
        event: &'life1 HookEvent,
    ) -> Pin<Box<dyn Future<Output = HookResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn fire_outcome<'life0, 'life1, 'async_trait>(
        &'life0 self,
        event: &'life1 HookEvent,
    ) -> Pin<Box<dyn Future<Output = HookOutcome> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn dispatch_observational(self: Arc<Self>, event: HookEvent) { ... }
    fn record_agent_event<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        _event: &'life1 AgentEvent,
        _run_id: &'life2 str,
        _session_id: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn record_run_cancelled<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        _run_id: &'life1 str,
        _session_id: &'life2 str,
        _reason: Option<&'life3 str>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
}
Expand description

Execution seam for in-process, SDK, and host-provided Hook runtimes.

Required Methods§

Source

fn fire<'life0, 'life1, 'async_trait>( &'life0 self, event: &'life1 HookEvent, ) -> Pin<Box<dyn Future<Output = HookResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn fire_outcome<'life0, 'life1, 'async_trait>( &'life0 self, event: &'life1 HookEvent, ) -> Pin<Box<dyn Future<Output = HookOutcome> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn dispatch_observational(self: Arc<Self>, event: HookEvent)

Dispatch an observational event without delaying protected work. Run-scoped executors override this to register the work with their capability supervisor before returning.

Source

fn record_agent_event<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _event: &'life1 AgentEvent, _run_id: &'life2 str, _session_id: &'life3 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn record_run_cancelled<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _run_id: &'life1 str, _session_id: &'life2 str, _reason: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§