pub struct WriteFileTool { /* private fields */ }Expand description
Built-in tool that writes content to a file, creating parent directories as needed.
Implementations§
Source§impl WriteFileTool
impl WriteFileTool
Trait Implementations§
Source§impl AgentTool for WriteFileTool
impl AgentTool for WriteFileTool
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 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