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§fn clone(&self) -> BeforeToolCallResult
fn clone(&self) -> BeforeToolCallResult
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 moreSource§impl Debug for BeforeToolCallResult
impl Debug for BeforeToolCallResult
Source§impl Default for BeforeToolCallResult
impl Default for BeforeToolCallResult
Source§fn default() -> BeforeToolCallResult
fn default() -> BeforeToolCallResult
Returns the “default value” for a type. Read more
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