pub struct ToolExecutor { /* private fields */ }Expand description
Executor for running external tools.
Caches tool availability checks for efficiency.
Implementations§
Source§impl ToolExecutor
impl ToolExecutor
Sourcepub fn new(default_timeout_ms: u64) -> Self
pub fn new(default_timeout_ms: u64) -> Self
Create a new executor with the given default timeout.
Sourcepub fn is_tool_available(&self, tool_name: &str) -> bool
pub fn is_tool_available(&self, tool_name: &str) -> bool
Check if a tool is available (lazy, cached).
Sourcepub fn execute(
&self,
tool_def: &ToolDefinition,
input: &str,
is_format_mode: bool,
timeout_ms: Option<u64>,
) -> Result<ToolOutput, ExecutorError>
pub fn execute( &self, tool_def: &ToolDefinition, input: &str, is_format_mode: bool, timeout_ms: Option<u64>, ) -> Result<ToolOutput, ExecutorError>
Sourcepub fn format(
&self,
tool_def: &ToolDefinition,
input: &str,
timeout_ms: Option<u64>,
) -> Result<String, ExecutorError>
pub fn format( &self, tool_def: &ToolDefinition, input: &str, timeout_ms: Option<u64>, ) -> Result<String, ExecutorError>
Execute a tool for formatting (returns formatted content).
Sourcepub fn lint(
&self,
tool_def: &ToolDefinition,
input: &str,
timeout_ms: Option<u64>,
) -> Result<ToolOutput, ExecutorError>
pub fn lint( &self, tool_def: &ToolDefinition, input: &str, timeout_ms: Option<u64>, ) -> Result<ToolOutput, ExecutorError>
Execute a tool for linting (returns diagnostics).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolExecutor
impl RefUnwindSafe for ToolExecutor
impl Send for ToolExecutor
impl Sync for ToolExecutor
impl Unpin for ToolExecutor
impl UnwindSafe for ToolExecutor
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 more