pub struct ToolRunner { /* private fields */ }Expand description
Tool runner for executing Python tools
Implementations§
Source§impl ToolRunner
impl ToolRunner
Sourcepub fn with_python(python: PathBuf) -> Result<Self>
pub fn with_python(python: PathBuf) -> Result<Self>
Create a tool runner with a specific Python executable
Sourcepub fn with_cache(cache: ToolCache) -> Self
pub fn with_cache(cache: ToolCache) -> Self
Create a tool runner with a custom cache
Sourcepub async fn run(&self, package: &str, args: &[String]) -> Result<ExitStatus>
pub async fn run(&self, package: &str, args: &[String]) -> Result<ExitStatus>
Run a tool with the given arguments
The package will be installed if not already cached. The tool executable is determined by the package name (e.g., “black” -> “black”).
Sourcepub async fn run_with_command(
&self,
package: &str,
command: &str,
args: &[String],
) -> Result<ExitStatus>
pub async fn run_with_command( &self, package: &str, command: &str, args: &[String], ) -> Result<ExitStatus>
Run a specific command from a package
Useful when the command name differs from the package name (e.g., package “Pillow” provides command “PIL”).
Sourcepub fn list_cached(&self) -> Result<Vec<CachedTool>>
pub fn list_cached(&self) -> Result<Vec<CachedTool>>
List cached tools
Auto Trait Implementations§
impl Freeze for ToolRunner
impl RefUnwindSafe for ToolRunner
impl Send for ToolRunner
impl Sync for ToolRunner
impl Unpin for ToolRunner
impl UnwindSafe for ToolRunner
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