pub struct ReplaceInFileTool { /* private fields */ }Expand description
Replaces exact text within a UTF-8 file.
Tool name: fs.replace_in_file
Fails if the search text is not found. Supports replacing only the first
occurrence (default) or all occurrences via the replace_all input flag.
§Example
use agentkit_tool_fs::ReplaceInFileTool;
use agentkit_tools_core::Tool;
let tool = ReplaceInFileTool::default();
assert_eq!(&tool.spec().name.0, "fs.replace_in_file");Trait Implementations§
Source§impl Clone for ReplaceInFileTool
impl Clone for ReplaceInFileTool
Source§fn clone(&self) -> ReplaceInFileTool
fn clone(&self) -> ReplaceInFileTool
Returns a duplicate of the value. Read more
1.0.0 · 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 ReplaceInFileTool
impl Debug for ReplaceInFileTool
Source§impl Default for ReplaceInFileTool
impl Default for ReplaceInFileTool
Source§impl Tool for ReplaceInFileTool
impl Tool for ReplaceInFileTool
Source§fn proposed_requests(
&self,
request: &ToolRequest,
) -> Result<Vec<Box<dyn PermissionRequest>>, ToolError>
fn proposed_requests( &self, request: &ToolRequest, ) -> Result<Vec<Box<dyn PermissionRequest>>, ToolError>
Source§fn invoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: ToolRequest,
ctx: &'life1 mut ToolContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn invoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: ToolRequest,
ctx: &'life1 mut ToolContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Executes the tool and returns a result or error. Read more
Auto Trait Implementations§
impl Freeze for ReplaceInFileTool
impl RefUnwindSafe for ReplaceInFileTool
impl Send for ReplaceInFileTool
impl Sync for ReplaceInFileTool
impl Unpin for ReplaceInFileTool
impl UnsafeUnpin for ReplaceInFileTool
impl UnwindSafe for ReplaceInFileTool
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