pub enum HookType {
Show 17 variants
PreToolUse,
PreMcpToolCall,
PostToolUse,
PostToolUseFailure,
UserPromptSubmitted,
SessionStart,
SessionEnd,
PostResult,
PrePRDescription,
ErrorOccurred,
AgentStop,
SubagentStart,
SubagentStop,
PreCompact,
PermissionRequest,
Notification,
Unknown,
}Expand description
Hook event name dispatched through the SDK callback transport.
Variants§
PreToolUse
Runs before a tool is invoked.
PreMcpToolCall
Runs before an MCP tool is invoked.
PostToolUse
Runs after a tool completes successfully.
PostToolUseFailure
Runs after a tool fails.
UserPromptSubmitted
Runs after the user submits a prompt.
SessionStart
Runs when a session starts.
SessionEnd
Runs when a session ends.
PostResult
Runs after an agent result is produced.
PrePRDescription
Runs before a pull request description is generated.
ErrorOccurred
Runs when the agent encounters an error.
AgentStop
Runs when the agent stops.
SubagentStart
Runs when a subagent starts.
SubagentStop
Runs when a subagent stops.
PreCompact
Runs before conversation context is compacted.
PermissionRequest
Runs when the agent requests permission.
Notification
Runs when the agent emits a notification.
Unknown
Unknown variant for forward compatibility.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HookType
impl<'de> Deserialize<'de> for HookType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for HookType
impl StructuralPartialEq for HookType
Auto Trait Implementations§
impl Freeze for HookType
impl RefUnwindSafe for HookType
impl Send for HookType
impl Sync for HookType
impl Unpin for HookType
impl UnsafeUnpin for HookType
impl UnwindSafe for HookType
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.