Skip to main content

matching_hooks

Function matching_hooks 

Source
pub fn matching_hooks<'a>(
    hooks: &'a [HookConfig],
    event: HookEvent,
    tool_name: Option<&str>,
) -> Vec<&'a HookConfig>
Expand description

Return all hooks that match a given event and (optionally) a tool name.

For tool-related events (PreToolUse, PostToolUse) the caller should pass the tool name so that per-tool matchers are evaluated. For session-level events the tool name is typically None and matchers are ignored.