Skip to main content

HookEngine

Trait HookEngine 

Source
pub trait HookEngine: Send + Sync {
    // Provided method
    fn dispatch<'a>(
        &'a self,
        _step: &'a mut dyn HookStep,
        _ctx: HookCtx<'a>,
    ) -> BoxFuture<'a, HookControl> { ... }
}
Expand description

Dispatcher for the main loop (step model).

The sole entry point is Self::dispatch: given a step::HookStep for a mount point, the engine finds matching handlers by event_name, feeds each handler the step envelope, applies the verdict back to the step (accumulating on the data axis), and merges the final step::HookControl (early exit on the control axis). Field mutations on the step (injection, argument changes, output filling, etc.) take effect in place. Summary: what the caller should read + control indication.

Default implementation is DefaultHookEngine; tests and default session setup use NoopHookEngine.

Provided Methods§

Source

fn dispatch<'a>( &'a self, _step: &'a mut dyn HookStep, _ctx: HookCtx<'a>, ) -> BoxFuture<'a, HookControl>

Default implementation returns step::HookControl::Proceed (no intervention); NoopHookEngine uses this directly. DefaultHookEngine overrides it for real dispatch.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§