#[non_exhaustive]pub enum Hook {
Command(CommandHook),
Prompt(PromptHook),
Agent(AgentHook),
Http(HttpHook),
McpTool(McpToolHook),
Other(Map<String, Value>),
}Expand description
A hook, by its type.
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.
Command(CommandHook)
command: run a shell command (or a program, with args).
Prompt(PromptHook)
prompt: ask a model about the event.
Agent(AgentHook)
agent: have an agent verify something.
Http(HttpHook)
http: POST the event to a URL.
McpTool(McpToolHook)
mcp_tool: call a tool on a connected MCP server.
Other(Map<String, Value>)
A type this crate doesn’t know (or none), the whole object as
written.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hook
impl<'de> Deserialize<'de> for Hook
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Hook
Auto Trait Implementations§
impl Forget for Hook
impl Freeze for Hookwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
impl Move for Hook
impl RefUnwindSafe for Hook
impl Send for Hook
impl Sync for Hook
impl Unpin for Hook
impl UnsafeUnpin for Hookwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
impl UnwindSafe for Hookwhere
RawVecInner: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
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