#[non_exhaustive]pub enum Event {
PreToolUse,
PostToolUse,
Custom(String),
}Expand description
Lifecycle event to attach to. Each integration maps this to its harness’s
own event name (e.g., PreToolUse on Claude Code, BeforeTool on Gemini,
tool.execute.before on OpenCode).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PreToolUse
Fire before a tool call is executed (the most common case; lets the hook modify or block the call).
PostToolUse
Fire after a tool call completes.
Custom(String)
Pass through a custom event name verbatim.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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