pub enum HookEvent<'a> {
AfterFileWrite {
file: &'a Path,
},
BeforeToolCall {
tool_name: &'a str,
args: &'a Value,
},
AfterToolCall {
tool_name: &'a str,
result: &'a ToolResultMessage,
},
BeforeLlmCall,
OnContextThreshold {
ratio: f64,
},
OnSessionStart,
OnSessionShutdown,
OnAgentStart {
prompt: &'a str,
},
OnAgentEnd {
messages: &'a [Message],
},
OnTurnEnd {
index: u32,
message: &'a AssistantMessage,
},
}Expand description
Runtime hook events.
Variants§
AfterFileWrite
BeforeToolCall
AfterToolCall
BeforeLlmCall
OnContextThreshold
OnSessionStart
OnSessionShutdown
OnAgentStart
OnAgentEnd
OnTurnEnd
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for HookEvent<'a>
impl<'a> RefUnwindSafe for HookEvent<'a>
impl<'a> Send for HookEvent<'a>
impl<'a> Sync for HookEvent<'a>
impl<'a> Unpin for HookEvent<'a>
impl<'a> UnsafeUnpin for HookEvent<'a>
impl<'a> UnwindSafe for HookEvent<'a>
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> 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 more