pub struct HookInput {
pub event_name: HookEventName,
pub matcher_value: Option<String>,
pub payload: Value,
}Expand description
Input passed to an SDK hook callback.
Fields§
§event_name: HookEventName§matcher_value: Option<String>§payload: ValueImplementations§
Source§impl HookInput
impl HookInput
Sourcepub fn string_field(&self, key: &str) -> Option<&str>
pub fn string_field(&self, key: &str) -> Option<&str>
Return a string payload field.
Sourcepub fn tool_use_id(&self) -> Option<&str>
pub fn tool_use_id(&self) -> Option<&str>
Tool use id for tool-related hook events.
Sourcepub fn decode<T: DeserializeOwned>(&self) -> Result<T>
pub fn decode<T: DeserializeOwned>(&self) -> Result<T>
Decode the entire hook payload into a typed struct.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HookInput
impl RefUnwindSafe for HookInput
impl Send for HookInput
impl Sync for HookInput
impl Unpin for HookInput
impl UnsafeUnpin for HookInput
impl UnwindSafe for HookInput
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