pub struct EditFileTool { /* private fields */ }Expand description
Built-in tool for making precise, surgical edits to a file.
Supports multiple edits per call, atomic writes, stale-read detection, whitespace-normalised matching, and line-number-based disambiguation.
Implementations§
Source§impl EditFileTool
impl EditFileTool
Trait Implementations§
Source§impl AgentTool for EditFileTool
impl AgentTool for EditFileTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Natural-language description included in the LLM prompt.
Source§fn parameters_schema(&self) -> &Value
fn parameters_schema(&self) -> &Value
JSON Schema describing the tool’s input shape, used for validation.
Source§fn requires_approval(&self) -> bool
fn requires_approval(&self) -> bool
Whether this tool requires user approval before execution.
Default is
false — tools execute immediately.Source§fn execute(
&self,
_tool_call_id: &str,
params: Value,
cancellation_token: CancellationToken,
_on_update: Option<Box<dyn Fn(AgentToolResult) + Send + Sync>>,
_state: Arc<RwLock<SessionState>>,
_credential: Option<ResolvedCredential>,
) -> ToolFuture<'_>
fn execute( &self, _tool_call_id: &str, params: Value, cancellation_token: CancellationToken, _on_update: Option<Box<dyn Fn(AgentToolResult) + Send + Sync>>, _state: Arc<RwLock<SessionState>>, _credential: Option<ResolvedCredential>, ) -> ToolFuture<'_>
Execute the tool with validated parameters. Read more
Source§fn metadata(&self) -> Option<ToolMetadata>
fn metadata(&self) -> Option<ToolMetadata>
Optional organizational metadata (namespace, version). Read more
Source§fn approval_context(&self, _params: &Value) -> Option<Value>
fn approval_context(&self, _params: &Value) -> Option<Value>
Optional rich context for the approval UI. Read more
Source§fn auth_config(&self) -> Option<AuthConfig>
fn auth_config(&self) -> Option<AuthConfig>
Optional authentication configuration for this tool. Read more
Auto Trait Implementations§
impl Freeze for EditFileTool
impl RefUnwindSafe for EditFileTool
impl Send for EditFileTool
impl Sync for EditFileTool
impl Unpin for EditFileTool
impl UnsafeUnpin for EditFileTool
impl UnwindSafe for EditFileTool
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