pub struct Workflow { /* private fields */ }Expand description
A workflow of tasks with dependencies
Implementations§
Source§impl Workflow
impl Workflow
Sourcepub fn add_task(&mut self, task: WorkflowTask) -> Uuid
pub fn add_task(&mut self, task: WorkflowTask) -> Uuid
Add a task to the workflow
Sourcepub fn get_task(&self, id: &Uuid) -> Option<&WorkflowTask>
pub fn get_task(&self, id: &Uuid) -> Option<&WorkflowTask>
Get a task by ID
Sourcepub fn get_entry_tasks(&self) -> Vec<&WorkflowTask>
pub fn get_entry_tasks(&self) -> Vec<&WorkflowTask>
Get all tasks with no dependencies (entry points)
Sourcepub fn get_dependent_tasks(&self, task_id: &Uuid) -> Vec<&WorkflowTask>
pub fn get_dependent_tasks(&self, task_id: &Uuid) -> Vec<&WorkflowTask>
Get tasks that depend on a specific task
Sourcepub fn has_cycles(&self) -> bool
pub fn has_cycles(&self) -> bool
Check if the workflow has cycles (invalid)
Sourcepub fn topological_sort(&self) -> Result<Vec<Uuid>, String>
pub fn topological_sort(&self) -> Result<Vec<Uuid>, String>
Get tasks in topological order (execution order)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Workflow
impl RefUnwindSafe for Workflow
impl Send for Workflow
impl Sync for Workflow
impl Unpin for Workflow
impl UnwindSafe for Workflow
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