pub struct Workflow {
pub id: String,
pub name: String,
pub nodes: Vec<Arc<dyn WorkflowNode>>,
pub edges: Vec<WorkflowEdge>,
pub start_node: String,
}Expand description
Workflow definition.
Fields§
§id: StringWorkflow ID.
name: StringWorkflow name.
nodes: Vec<Arc<dyn WorkflowNode>>Nodes in the workflow.
edges: Vec<WorkflowEdge>Edges connecting nodes.
start_node: StringStarting node ID.
Implementations§
Source§impl Workflow
impl Workflow
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
start_node: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, start_node: impl Into<String>, ) -> Self
Create a new workflow.
Sourcepub fn add_node(&mut self, node: Arc<dyn WorkflowNode>)
pub fn add_node(&mut self, node: Arc<dyn WorkflowNode>)
Add a node.
Sourcepub fn add_conditional_edge(
&mut self,
from: impl Into<String>,
to: impl Into<String>,
condition: impl Into<String>,
)
pub fn add_conditional_edge( &mut self, from: impl Into<String>, to: impl Into<String>, condition: impl Into<String>, )
Add a conditional edge.
Sourcepub fn outgoing_edges(&self, node_id: &str) -> Vec<&WorkflowEdge>
pub fn outgoing_edges(&self, node_id: &str) -> Vec<&WorkflowEdge>
Find outgoing edges from a node.
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