pub struct BeforeToolCallResult {
pub block: bool,
pub reason: Option<String>,
pub terminate: bool,
pub args: Option<Value>,
}Expand description
Result of a before_tool_call hook. block prevents execution; the loop
emits an error tool result with reason (or a default) instead. terminate
participates in the batch early-termination rule (all results must set it).
args is the Rust equivalent of TS beforeToolCall mutating the validated
args object in place: JS callbacks receive args by reference and write to
it; Rust hands the hook an immutable &serde_json::Value, so to rewrite the
args the hook returns them here. Replacement args are applied without
re-validation — mirroring TS, where the mutation happens after
validateToolArguments and is never re-checked. None keeps the validated
args.
Fields§
§block: bool§reason: Option<String>§terminate: bool§args: Option<Value>Trait Implementations§
Source§impl Clone for BeforeToolCallResult
impl Clone for BeforeToolCallResult
Source§impl Debug for BeforeToolCallResult
impl Debug for BeforeToolCallResult
Auto Trait Implementations§
impl Freeze for BeforeToolCallResult
impl RefUnwindSafe for BeforeToolCallResult
impl Send for BeforeToolCallResult
impl Sync for BeforeToolCallResult
impl Unpin for BeforeToolCallResult
impl UnsafeUnpin for BeforeToolCallResult
impl UnwindSafe for BeforeToolCallResult
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