pub struct ToolDispatchContext<'a> {
pub tool_name: &'a str,
pub tool_call_id: &'a str,
pub arguments: &'a mut Value,
pub execution_root: Option<&'a Path>,
pub state: &'a SessionState,
}Expand description
Combined context for PreDispatch policies.
Contains only the data reliably available during tool dispatch — the per-call fields and read-only session state. Loop-level metrics (turn index, accumulated usage/cost, message count, overflow signal) are intentionally excluded: they are not tracked at the tool dispatch call site, and fabricating placeholder values would give policies incorrect data to reason from.
Fields§
§tool_name: &'a strName of the tool being called.
tool_call_id: &'a strUnique identifier for this tool call.
arguments: &'a mut ValueMutable reference to tool call arguments (policies may rewrite them).
execution_root: Option<&'a Path>Working directory the tool will resolve relative paths against, when known.
state: &'a SessionStateRead-only access to the session state.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ToolDispatchContext<'a>
impl<'a> RefUnwindSafe for ToolDispatchContext<'a>
impl<'a> Send for ToolDispatchContext<'a>
impl<'a> Sync for ToolDispatchContext<'a>
impl<'a> Unpin for ToolDispatchContext<'a>
impl<'a> UnsafeUnpin for ToolDispatchContext<'a>
impl<'a> !UnwindSafe for ToolDispatchContext<'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