pub struct WorkflowGraph { /* private fields */ }Expand description
The main workflow graph that orchestrates node execution
Implementations§
Source§impl WorkflowGraph
impl WorkflowGraph
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the graph description
Sourcepub async fn add_node(
&mut self,
node_id: impl Into<NodeId>,
node: Arc<dyn Node>,
) -> RGraphResult<()>
pub async fn add_node( &mut self, node_id: impl Into<NodeId>, node: Arc<dyn Node>, ) -> RGraphResult<()>
Add a node to the graph
Sourcepub fn add_edge(
&mut self,
from: impl Into<NodeId>,
to: impl Into<NodeId>,
) -> RGraphResult<EdgeId>
pub fn add_edge( &mut self, from: impl Into<NodeId>, to: impl Into<NodeId>, ) -> RGraphResult<EdgeId>
Add an edge between two nodes
Sourcepub fn add_edge_with_condition(
&mut self,
from: impl Into<NodeId>,
to: impl Into<NodeId>,
condition: EdgeCondition,
) -> RGraphResult<EdgeId>
pub fn add_edge_with_condition( &mut self, from: impl Into<NodeId>, to: impl Into<NodeId>, condition: EdgeCondition, ) -> RGraphResult<EdgeId>
Add an edge with a condition
Sourcepub fn add_conditional_edge<F>(
&mut self,
from: impl Into<NodeId>,
_condition_fn: F,
) -> RGraphResult<EdgeId>
pub fn add_conditional_edge<F>( &mut self, from: impl Into<NodeId>, _condition_fn: F, ) -> RGraphResult<EdgeId>
Add a conditional edge with a custom routing function
Sourcepub fn set_entry_points(&mut self, entry_points: Vec<NodeId>)
pub fn set_entry_points(&mut self, entry_points: Vec<NodeId>)
Set entry points for the graph
Sourcepub fn set_exit_points(&mut self, exit_points: Vec<NodeId>)
pub fn set_exit_points(&mut self, exit_points: Vec<NodeId>)
Set exit points for the graph
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Get the graph description
Sourcepub fn entry_points(&self) -> Vec<NodeId>
pub fn entry_points(&self) -> Vec<NodeId>
Get entry points (returns owned values to avoid lifetime issues)
Sourcepub fn entry_points_owned(&self) -> Vec<NodeId>
pub fn entry_points_owned(&self) -> Vec<NodeId>
Get entry points as owned values
Sourcepub fn validate(&self) -> RGraphResult<()>
pub fn validate(&self) -> RGraphResult<()>
Validate the graph structure
Auto Trait Implementations§
impl Freeze for WorkflowGraph
impl !RefUnwindSafe for WorkflowGraph
impl Send for WorkflowGraph
impl Sync for WorkflowGraph
impl Unpin for WorkflowGraph
impl !UnwindSafe for WorkflowGraph
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