pub struct WriteFileTool { /* private fields */ }Expand description
Writes UTF-8 text to a file, creating parent directories if needed.
Tool name: fs.write_file
If require_read_before_write is active and the target file already exists,
this tool will refuse to execute unless the path was previously inspected
during the same session.
§Example
use agentkit_tool_fs::WriteFileTool;
use agentkit_tools_core::Tool;
let tool = WriteFileTool::default();
assert_eq!(&tool.spec().name.0, "fs.write_file");Trait Implementations§
Source§impl Clone for WriteFileTool
impl Clone for WriteFileTool
Source§fn clone(&self) -> WriteFileTool
fn clone(&self) -> WriteFileTool
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 WriteFileTool
impl Debug for WriteFileTool
Source§impl Default for WriteFileTool
impl Default for WriteFileTool
Source§impl Tool for WriteFileTool
impl Tool for WriteFileTool
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 WriteFileTool
impl RefUnwindSafe for WriteFileTool
impl Send for WriteFileTool
impl Sync for WriteFileTool
impl Unpin for WriteFileTool
impl UnsafeUnpin for WriteFileTool
impl UnwindSafe for WriteFileTool
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