pub struct EngineGuard { /* private fields */ }Expand description
A guard that manages access to an engine instance from the pool
Implementations§
Source§impl EngineGuard
impl EngineGuard
Sourcepub fn engine_mut(&mut self) -> &mut Engine
pub fn engine_mut(&mut self) -> &mut Engine
Get a mutable reference to the engine
Sourcepub async fn execute_plan_with_reset(
&mut self,
plan_name: &str,
default_input: Option<String>,
) -> Result<ExecutionContext>
pub async fn execute_plan_with_reset( &mut self, plan_name: &str, default_input: Option<String>, ) -> Result<ExecutionContext>
Execute a plan and automatically reset the engine state afterwards
Sourcepub fn reset_execution_state(&mut self)
pub fn reset_execution_state(&mut self)
Reset the execution state (clear any cached results/contexts)
Methods from Deref<Target = Engine>§
Sourcepub fn auto_discover_scripts(&self) -> Result<usize>
pub fn auto_discover_scripts(&self) -> Result<usize>
Auto-discover scripts from the scripts directory
Sourcepub fn load_script(&self, script_dir: PathBuf) -> Result<()>
pub fn load_script(&self, script_dir: PathBuf) -> Result<()>
Load a single script from a directory
Sourcepub fn add_script(&self, script: Script) -> Result<()>
pub fn add_script(&self, script: Script) -> Result<()>
Add a script directly
Sourcepub fn get_script(&self, name: &str) -> Option<Script>
pub fn get_script(&self, name: &str) -> Option<Script>
Get a script by name
Sourcepub fn list_scripts(&self) -> Vec<String>
pub fn list_scripts(&self) -> Vec<String>
List all available scripts
Sourcepub fn load_plan_from_str(&self, toml_str: &str) -> Result<()>
pub fn load_plan_from_str(&self, toml_str: &str) -> Result<()>
Load a plan from a TOML string
Sourcepub fn list_plans(&self) -> Vec<String>
pub fn list_plans(&self) -> Vec<String>
List all available plans
Sourcepub async fn execute_script(
&self,
script_name: &str,
args: Vec<String>,
) -> Result<ExecutionResult>
pub async fn execute_script( &self, script_name: &str, args: Vec<String>, ) -> Result<ExecutionResult>
Execute a single script with arguments
Sourcepub async fn execute_plan(
&self,
plan_name: &str,
default_input: Option<String>,
) -> Result<ExecutionContext>
pub async fn execute_plan( &self, plan_name: &str, default_input: Option<String>, ) -> Result<ExecutionContext>
Execute a plan with optional default input (with parallel execution)
Sourcepub fn validate_all_plans(&self) -> Result<()>
pub fn validate_all_plans(&self) -> Result<()>
Validate all loaded plans against available scripts
Trait Implementations§
Source§impl Deref for EngineGuard
impl Deref for EngineGuard
Source§impl DerefMut for EngineGuard
impl DerefMut for EngineGuard
Auto Trait Implementations§
impl Freeze for EngineGuard
impl !RefUnwindSafe for EngineGuard
impl Send for EngineGuard
impl Sync for EngineGuard
impl Unpin for EngineGuard
impl !UnwindSafe for EngineGuard
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