new • Rust AI Agent SDK

new: Create a new hook definition

new

Method

</div>

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

Create a new hook definition

Signature

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

Parameters

ParamField HookEvent

No description available.

ParamField impl Fn(&HookInput

No description available.

Returns

ResponseField

Self”> The result of the operation.