pub struct ToolGate {
pub id: String,
pub name: String,
pub args: Value,
pub result: Option<ToolResult>,
pub blocked: bool,
pub block_reason: Option<String>,
pub pending: bool,
pub suspend_ticket: Option<SuspendTicket>,
}Expand description
Tool-gate extension: per-tool-call execution control.
Populated by BlockTool, AllowTool, SuspendTool,
OverrideToolResult actions during BeforeToolExecute.
Fields§
§id: StringTool call ID.
name: StringTool name.
args: ValueTool arguments.
result: Option<ToolResult>Tool execution result (set after execution or by override).
blocked: boolWhether execution is blocked.
block_reason: Option<String>Block reason.
pending: boolWhether execution is pending user confirmation.
suspend_ticket: Option<SuspendTicket>Canonical suspend ticket carrying pause payload.
Implementations§
Source§impl ToolGate
impl ToolGate
Sourcepub fn new(id: impl Into<String>, name: impl Into<String>, args: Value) -> Self
pub fn new(id: impl Into<String>, name: impl Into<String>, args: Value) -> Self
Create a new tool gate from identifiers and arguments.
Sourcepub fn from_tool_call(call: &ToolCall) -> Self
pub fn from_tool_call(call: &ToolCall) -> Self
Create from a ToolCall.
Sourcepub fn is_blocked(&self) -> bool
pub fn is_blocked(&self) -> bool
Check if the tool execution is blocked.
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Check if the tool execution is pending.
Sourcepub fn idempotency_key(&self) -> &str
pub fn idempotency_key(&self) -> &str
Stable idempotency key for this tool invocation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolGate
impl RefUnwindSafe for ToolGate
impl Send for ToolGate
impl Sync for ToolGate
impl Unpin for ToolGate
impl UnwindSafe for ToolGate
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