pub struct HookInput {
pub session_id: String,
pub timestamp: DateTime<Utc>,
pub data: HookEventData,
pub metadata: Option<Value>,
}Fields§
§session_id: String§timestamp: DateTime<Utc>§data: HookEventData§metadata: Option<Value>Implementations§
Source§impl HookInput
impl HookInput
pub fn new(session_id: impl Into<String>, data: HookEventData) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
pub fn event_type(&self) -> HookEvent
pub fn tool_name(&self) -> Option<&str>
pub fn subagent_id(&self) -> Option<&str>
pub fn pre_tool_use( session_id: impl Into<String>, tool_name: impl Into<String>, tool_input: Value, ) -> Self
pub fn post_tool_use( session_id: impl Into<String>, tool_name: impl Into<String>, tool_result: ToolOutput, ) -> Self
pub fn post_tool_use_failure( session_id: impl Into<String>, tool_name: impl Into<String>, error: impl Into<String>, ) -> Self
pub fn user_prompt_submit( session_id: impl Into<String>, prompt: impl Into<String>, ) -> Self
pub fn session_start(session_id: impl Into<String>) -> Self
pub fn session_end(session_id: impl Into<String>) -> Self
pub fn stop(session_id: impl Into<String>) -> Self
pub fn pre_compact(session_id: impl Into<String>) -> Self
pub fn subagent_start( session_id: impl Into<String>, subagent_id: impl Into<String>, subagent_type: impl Into<String>, description: impl Into<String>, ) -> Self
pub fn subagent_stop( session_id: impl Into<String>, subagent_id: impl Into<String>, success: bool, error: Option<String>, ) -> Self
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.