pub struct CreateDirectoryTool { /* private fields */ }Expand description
Tool for creating directories
Implementations§
Source§impl CreateDirectoryTool
impl CreateDirectoryTool
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new tool using the current working directory as the base path.
Equivalent to Default::default().
§Panics
Panics if the current working directory cannot be determined.
Use try_new or with_base_path instead.
Sourcepub fn try_new() -> Result<Self>
pub fn try_new() -> Result<Self>
Creates a new tool using the current working directory as the base path.
Returns an error if the current working directory cannot be determined.
Sourcepub fn with_base_path(base_path: PathBuf) -> Self
pub fn with_base_path(base_path: PathBuf) -> Self
Creates a tool with a custom base directory.
All file operations will be constrained to this directory.
Trait Implementations§
Source§impl Default for CreateDirectoryTool
impl Default for CreateDirectoryTool
Source§impl Tool for CreateDirectoryTool
impl Tool for CreateDirectoryTool
Source§type Input = CreateDirectoryInput
type Input = CreateDirectoryInput
The input type for this tool. Must implement
Deserialize and JsonSchema.Source§fn description(&self) -> &str
fn description(&self) -> &str
A description of what the tool does
Source§async fn execute(&self, input: Self::Input) -> Result<ToolResult, ToolError>
async fn execute(&self, input: Self::Input) -> Result<ToolResult, ToolError>
Execute the tool with typed input
Source§fn input_schema(&self) -> Value
fn input_schema(&self) -> Value
Get the JSON schema for this tool’s input. Read more
Source§fn format_input_plain(&self, params: &Value) -> String
fn format_input_plain(&self, params: &Value) -> String
Format tool input as plain text (for JIRA, logs, copy/paste). Read more
Source§fn format_input_ansi(&self, params: &Value) -> String
fn format_input_ansi(&self, params: &Value) -> String
Format tool input with ANSI colors (for terminal display). Read more
Source§fn format_input_markdown(&self, params: &Value) -> String
fn format_input_markdown(&self, params: &Value) -> String
Format tool input as Markdown (for docs, GitHub, rendered UIs). Read more
Source§fn format_output_plain(&self, result: &ToolResult) -> String
fn format_output_plain(&self, result: &ToolResult) -> String
Format tool output as plain text. Read more
Source§fn format_output_ansi(&self, result: &ToolResult) -> String
fn format_output_ansi(&self, result: &ToolResult) -> String
Format tool output with ANSI colors. Read more
Source§fn format_output_markdown(&self, result: &ToolResult) -> String
fn format_output_markdown(&self, result: &ToolResult) -> String
Format tool output as Markdown. Read more
Auto Trait Implementations§
impl Freeze for CreateDirectoryTool
impl RefUnwindSafe for CreateDirectoryTool
impl Send for CreateDirectoryTool
impl Sync for CreateDirectoryTool
impl Unpin for CreateDirectoryTool
impl UnsafeUnpin for CreateDirectoryTool
impl UnwindSafe for CreateDirectoryTool
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.