pub trait HookHandler: Send + Sync {
// Required method
fn handle(&self, event: &HookEvent) -> HookResponse;
// Provided method
fn try_handle(&self, event: &HookEvent) -> Result<HookResponse, String> { ... }
}Expand description
Hook handler trait
Required Methods§
Sourcefn handle(&self, event: &HookEvent) -> HookResponse
fn handle(&self, event: &HookEvent) -> HookResponse
Handle a hook event
Provided Methods§
Sourcefn try_handle(&self, event: &HookEvent) -> Result<HookResponse, String>
fn try_handle(&self, event: &HookEvent) -> Result<HookResponse, String>
Handle a hook event while preserving callback infrastructure failures.
Native handlers can rely on the default implementation. SDK bridges
should override this method so language exceptions and callback channel
failures reach the engine instead of being converted to Continue.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".