pub(crate) struct HookRegistry {
pub(crate) by_id: HashMap<String, Arc<dyn ErasedHookCallback>>,
pub(crate) metadata: Vec<HookRegistryEntry>,
pub(crate) default_timeout_secs: Option<u64>,
}Expand description
Internal bundle mapping opaque ids to erased callbacks, with parallel metadata for the initialize payload.
Fields§
§by_id: HashMap<String, Arc<dyn ErasedHookCallback>>§metadata: Vec<HookRegistryEntry>§default_timeout_secs: Option<u64>Implementations§
Source§impl HookRegistry
impl HookRegistry
Sourcepub(crate) fn to_initialize_payload(&self) -> Value
pub(crate) fn to_initialize_payload(&self) -> Value
Render the hooks field of the initialize control_request:
{"PreToolUse": [{"matcher": "...", "hookCallbackIds": ["hook_0"], "timeout": 120}, ...], ...}.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HookRegistry
impl !UnwindSafe for HookRegistry
impl Freeze for HookRegistry
impl Send for HookRegistry
impl Sync for HookRegistry
impl Unpin for HookRegistry
impl UnsafeUnpin for HookRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more