pub struct ToolPostContext {
pub turn: usize,
pub tool: String,
pub result_hash: Option<u64>,
pub is_error: bool,
pub duration: Duration,
}Expand description
Context for LoopObserver::on_tool_post.
Sent after a tool completes, providing the tool name, a hash of the output, whether an error occurred, and the execution duration.
Fields§
§turn: usizeTurn number.
Identifies which turn this tool result belongs to.
tool: StringTool name.
Matches the name the tool was registered under.
result_hash: Option<u64>Deterministic hash of the tool output, if available.
Used by loop detection to identify repeated tool results without exposing the full output content.
is_error: boolWhether the tool returned an error.
true when the tool execution resulted in an error
response rather than a successful output.
duration: DurationWall-clock execution duration.
Measured from tool dispatch to completion, including any permission prompts.
Trait Implementations§
Source§impl Clone for ToolPostContext
impl Clone for ToolPostContext
Source§fn clone(&self) -> ToolPostContext
fn clone(&self) -> ToolPostContext
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 moreAuto Trait Implementations§
impl Freeze for ToolPostContext
impl RefUnwindSafe for ToolPostContext
impl Send for ToolPostContext
impl Sync for ToolPostContext
impl Unpin for ToolPostContext
impl UnsafeUnpin for ToolPostContext
impl UnwindSafe for ToolPostContext
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