pub struct Engine { /* private fields */ }Expand description
The main workflow engine
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn with_executor(executor: Arc<dyn Executor + Send + Sync>) -> Self
pub fn with_executor(executor: Arc<dyn Executor + Send + Sync>) -> Self
Create a new engine with a custom executor
Sourcepub fn with_scripts_dir(self, scripts_dir: PathBuf) -> Self
pub fn with_scripts_dir(self, scripts_dir: PathBuf) -> Self
Set the base directory for auto-discovering scripts
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§
Auto Trait Implementations§
impl Freeze for Engine
impl !RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl !UnwindSafe for Engine
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