pub enum GraphEdge {
Fixed {
source: String,
target: String,
},
Conditional {
source: String,
router_name: String,
targets: HashMap<String, String>,
default_target: Option<String>,
},
FanOut {
source: String,
targets: Vec<String>,
},
FanIn {
sources: Vec<String>,
target: String,
},
}Expand description
Graph Edge enum
Represents a transition in the graph. Can be:
- Fixed: Always transitions to a specific node
- Conditional: Routes based on state via a routing function
Variants§
Fixed
Fixed edge: always transitions to a specific target node.
Conditional
Conditional edge: routes to a target based on state via a routing function.
Fields
FanOut
FanOut edge: one source → multiple targets (parallel execution)
FanIn
FanIn edge: multiple sources → one target (join point)
Implementations§
Source§impl GraphEdge
impl GraphEdge
Sourcepub fn fixed(source: impl Into<String>, target: impl Into<String>) -> Self
pub fn fixed(source: impl Into<String>, target: impl Into<String>) -> Self
Create a fixed edge from source to target.
Sourcepub fn conditional<R, T>(
source: impl Into<String>,
router_name: impl Into<String>,
targets: HashMap<R, T>,
default: Option<T>,
) -> Self
pub fn conditional<R, T>( source: impl Into<String>, router_name: impl Into<String>, targets: HashMap<R, T>, default: Option<T>, ) -> Self
Create a conditional edge routed by a named routing function.
Sourcepub fn fan_out(source: impl Into<String>, targets: Vec<String>) -> Self
pub fn fan_out(source: impl Into<String>, targets: Vec<String>) -> Self
Create a FanOut edge with multiple parallel targets.
Sourcepub fn fan_in(sources: Vec<String>, target: impl Into<String>) -> Self
pub fn fan_in(sources: Vec<String>, target: impl Into<String>) -> Self
Create a FanIn edge joining multiple sources into one target.
Sourcepub fn fixed_target(&self) -> Option<&str>
pub fn fixed_target(&self) -> Option<&str>
Return the fixed target node, if this edge has one.
Sourcepub fn fan_out_targets(&self) -> Option<&Vec<String>>
pub fn fan_out_targets(&self) -> Option<&Vec<String>>
Return the FanOut targets, if this is a FanOut edge.
Sourcepub fn fan_in_sources(&self) -> Option<&Vec<String>>
pub fn fan_in_sources(&self) -> Option<&Vec<String>>
Return the FanIn sources, if this is a FanIn edge.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphEdge
impl RefUnwindSafe for GraphEdge
impl Send for GraphEdge
impl Sync for GraphEdge
impl Unpin for GraphEdge
impl UnsafeUnpin for GraphEdge
impl UnwindSafe for GraphEdge
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