Public declaration syntax from forge-rs/crates/forge-tool/src/execution.rs Original source SHA-256: a9ddfd4dfdc41b74c859fd7f2c5371354d47b000ed4c66017475e94ba72e5214 Function bodies and constant values are omitted. This is not the complete implementation. Source line 88 #[async_trait] pub trait ToolExecutor: Send + Sync { /// Executes the tool with the given call arguments. /// /// # Arguments /// /// * `call` - The tool call containing the call ID, tool name, and JSON arguments. /// /// # Returns /// /// A [`ToolResult`] with the execution output on success, or a /// [`ForgeToolError::ExecutionFailed`] on failure. /// /// # Errors /// /// Returns [`ForgeToolError::ExecutionFailed`] if the tool logic fails for /// any reason (network timeout, invalid state, computation error, etc.). async fn execute(&self, call: &ToolCall) -> Result; /// Returns the name of the tool this executor handles. /// /// This must match the [`ToolDefinition::name`](forge_core::tool::ToolDefinition::name) /// of the corresponding tool definition. fn name(&self) -> &str; } Source line 142 pub struct FnToolExecutor where F: Fn(&ToolCall) -> Result + Send + Sync + 'static, { } Source line 185 pub fn new(name: impl Into, handler: F) -> Self; Source line 302 pub async fn execute_tool_call( call: &ToolCall, definition: &forge_core::tool::ToolDefinition, executor: &dyn ToolExecutor, approval_handler: &dyn crate::approval::ApprovalHandler, ) -> Result;