Add Hook • Rust AI Agent SDK

add_hook: Add a hook

add_hook

Method

</div>

This is a method of the HookRegistry class in the hooks module.

Add a hook

Diagram

Allow

Deny

Event Trigger

Hook: add_hook

Decision

Process

Block

Signature

python
def add_hook(
        &mut self,
        event: HookEvent,
        func: impl Fn(&HookInput) -> HookResult + Send + Sync + 'static,
    ) -> &mut Self

Parameters

ParamField HookEvent

No description available.

ParamField impl Fn(&HookInput

No description available.

Returns

ResponseField

&mut Self”> The result of the operation.


Related Documentation