pub struct PythonExecutor { /* private fields */ }Expand description
Python script executor
Executes Python scripts using the python3 interpreter.
Implementations§
Source§impl PythonExecutor
impl PythonExecutor
Sourcepub fn with_path(python_path: impl Into<String>) -> Self
pub fn with_path(python_path: impl Into<String>) -> Self
Create with custom Python interpreter path
§Example
use turboclaude_skills::executor::PythonExecutor;
let executor = PythonExecutor::with_path("/usr/local/bin/python3.11");Sourcepub fn with_validator(self, validator: PathValidator) -> Self
pub fn with_validator(self, validator: PathValidator) -> Self
Set a path validator for security
When set, all script paths will be validated against the base directory. This prevents directory traversal attacks.
§Example
use turboclaude_skills::executor::{PythonExecutor, PathValidator};
use std::path::PathBuf;
let validator = PathValidator::new("/home/user/scripts");
let executor = PythonExecutor::new().with_validator(validator);Trait Implementations§
Source§impl Default for PythonExecutor
impl Default for PythonExecutor
Source§impl ScriptExecutor for PythonExecutor
impl ScriptExecutor for PythonExecutor
Source§fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 Path,
args: &'life2 [&'life3 str],
timeout_duration: Duration,
) -> Pin<Box<dyn Future<Output = Result<ScriptOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 Path,
args: &'life2 [&'life3 str],
timeout_duration: Duration,
) -> Pin<Box<dyn Future<Output = Result<ScriptOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Execute a script with arguments and timeout Read more
Auto Trait Implementations§
impl Freeze for PythonExecutor
impl RefUnwindSafe for PythonExecutor
impl Send for PythonExecutor
impl Sync for PythonExecutor
impl Unpin for PythonExecutor
impl UnwindSafe for PythonExecutor
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