pub struct HookConfig {
pub event: String,
pub command: String,
pub tools: Vec<String>,
pub timeout_secs: Option<u64>,
}Expand description
One hook: a command run at a lifecycle point, with the event payload as JSON on stdin.
Fields§
§event: Stringpre_tool | post_tool | session_end. An unknown event is a startup
error, not a warning — a policy hook that never fires because its event
name has a typo is the silently-degrading-sandbox mistake again.
command: StringRun via sh -c, as the user, in the workspace.
tools: Vec<String>Only fire for these tools (pre_tool/post_tool). Empty means all.
timeout_secs: Option<u64>Kill the hook after this long. The default is deliberately short: a
pre_tool hook is on the critical path of every call it matches.
Trait Implementations§
Source§impl Clone for HookConfig
impl Clone for HookConfig
Source§fn clone(&self) -> HookConfig
fn clone(&self) -> HookConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HookConfig
impl Debug for HookConfig
Source§impl Default for HookConfig
impl Default for HookConfig
Source§fn default() -> HookConfig
fn default() -> HookConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HookConfigwhere
HookConfig: Default,
impl<'de> Deserialize<'de> for HookConfigwhere
HookConfig: Default,
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
Auto Trait Implementations§
impl Freeze for HookConfig
impl RefUnwindSafe for HookConfig
impl Send for HookConfig
impl Sync for HookConfig
impl Unpin for HookConfig
impl UnsafeUnpin for HookConfig
impl UnwindSafe for HookConfig
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