Skip to main content

ri_agent_graph/
edge.rs

1use crate::router::RoutingFunction;
2
3/// Type of edge in the graph
4pub enum EdgeType {
5    /// Normal edge: always goes to specified node
6    Normal(String),
7
8    /// Conditional edge: calls router to determine next node
9    Conditional(Box<dyn RoutingFunction>),
10}
11
12impl std::fmt::Debug for EdgeType {
13    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14        match self {
15            EdgeType::Normal(next) => write!(f, "Normal({})", next),
16            EdgeType::Conditional(_) => write!(f, "Conditional(<router>)"),
17        }
18    }
19}