pub struct DagEngine { /* private fields */ }Expand description
DAG execution engine — validates and runs workflow graphs.
Implementations§
Source§impl DagEngine
impl DagEngine
pub fn new() -> Self
Sourcepub fn register_workflow(&mut self, workflow: Workflow) -> WorkflowResult<()>
pub fn register_workflow(&mut self, workflow: Workflow) -> WorkflowResult<()>
Register a workflow definition.
Sourcepub fn get_workflow(&self, id: &str) -> WorkflowResult<&Workflow>
pub fn get_workflow(&self, id: &str) -> WorkflowResult<&Workflow>
Get a workflow by ID.
Sourcepub fn remove_workflow(&mut self, id: &str) -> WorkflowResult<Workflow>
pub fn remove_workflow(&mut self, id: &str) -> WorkflowResult<Workflow>
Remove a workflow.
Sourcepub fn list_workflows(&self) -> Vec<&Workflow>
pub fn list_workflows(&self) -> Vec<&Workflow>
List all registered workflows.
Sourcepub fn validate_dag(&self, workflow: &Workflow) -> WorkflowResult<()>
pub fn validate_dag(&self, workflow: &Workflow) -> WorkflowResult<()>
Validate the DAG — check for cycles and unsatisfied dependencies.
Sourcepub fn topological_sort(
&self,
workflow: &Workflow,
) -> WorkflowResult<Vec<String>>
pub fn topological_sort( &self, workflow: &Workflow, ) -> WorkflowResult<Vec<String>>
Topological sort of steps — returns execution order or error if cycle.
Sourcepub fn start_execution(&mut self, workflow_id: &str) -> WorkflowResult<String>
pub fn start_execution(&mut self, workflow_id: &str) -> WorkflowResult<String>
Start a new execution of a workflow.
Sourcepub fn get_progress(
&self,
execution_id: &str,
) -> WorkflowResult<ExecutionProgress>
pub fn get_progress( &self, execution_id: &str, ) -> WorkflowResult<ExecutionProgress>
Get execution progress.
Sourcepub fn pause_execution(&mut self, execution_id: &str) -> WorkflowResult<()>
pub fn pause_execution(&mut self, execution_id: &str) -> WorkflowResult<()>
Pause a running execution.
Sourcepub fn resume_execution(&mut self, execution_id: &str) -> WorkflowResult<()>
pub fn resume_execution(&mut self, execution_id: &str) -> WorkflowResult<()>
Resume a paused execution.
Sourcepub fn cancel_execution(&mut self, execution_id: &str) -> WorkflowResult<()>
pub fn cancel_execution(&mut self, execution_id: &str) -> WorkflowResult<()>
Cancel a running execution.
Sourcepub fn get_execution(
&self,
execution_id: &str,
) -> WorkflowResult<&ExecutionContext>
pub fn get_execution( &self, execution_id: &str, ) -> WorkflowResult<&ExecutionContext>
Get execution context.
Sourcepub fn visualize_mermaid(&self, workflow_id: &str) -> WorkflowResult<String>
pub fn visualize_mermaid(&self, workflow_id: &str) -> WorkflowResult<String>
Generate a Mermaid diagram for a workflow.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DagEngine
impl RefUnwindSafe for DagEngine
impl Send for DagEngine
impl Sync for DagEngine
impl Unpin for DagEngine
impl UnsafeUnpin for DagEngine
impl UnwindSafe for DagEngine
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