pub trait Hook: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn fql_pattern(&self) -> &FqlPattern;
fn hook_point(&self) -> HookPoint;
fn execute(&self, ctx: HookContext) -> HookAction;
// Provided method
fn priority(&self) -> i32 { ... }
}Expand description
A single hook handler.
Hooks are registered with the HookRegistry and
invoked at specific lifecycle points. Each hook declares:
- An FQL pattern (which components it targets)
- A hook point (when it fires)
- A priority (execution order within the same point)
§Thread Safety
Hooks must be Send + Sync for concurrent access from multiple
channel runners.
Required Methods§
Sourcefn fql_pattern(&self) -> &FqlPattern
fn fql_pattern(&self) -> &FqlPattern
FQL pattern this hook matches.
Sourcefn hook_point(&self) -> HookPoint
fn hook_point(&self) -> HookPoint
Which lifecycle point this hook fires on.
Sourcefn execute(&self, ctx: HookContext) -> HookAction
fn execute(&self, ctx: HookContext) -> HookAction
Execute the hook with the given context.
§Returns
Continue(ctx)— pass modified context to next hook / operationSkip(value)— skip the operation (pre-hooks only)Abort { reason }— abort the operation (pre-hooks only)Replace(value)— replace result payload (post-hooks only)