pub struct SendEdge<S>{
pub selector: SendSelector<S>,
pub merger: SendMerger<S>,
pub join: String,
/* private fields */
}Expand description
Parallel fan-out edge.
After the source node completes, the runtime evaluates selector
to obtain branches, runs each target node in parallel, folds the
post-branch states via the state’s
StateMerge::merge impl, then jumps
to join.
The target list is stored as both an ordered Vec (preserving
the declaration order the operator passed to
crate::StateGraph::add_send_edges) and a HashSet for
O(1) membership checks at dispatch time. The split lets compile-
error messages and Debug output reflect the operator’s source
order — flaky test output and grep-unfriendly logs would
otherwise leak into every dashboard.
Fields§
§selector: SendSelector<S>Branch-set producer. Must return (target, branch_state)
pairs whose target is a member of targets.
merger: SendMerger<S>Per-branch merger applied during the post-fan-out fold —
see SendMerger.
join: StringNode that receives the merged state, or crate::END for
terminal fan-outs that complete after the merge.
Implementations§
Source§impl<S> SendEdge<S>
impl<S> SendEdge<S>
Sourcepub fn new(
targets: impl IntoIterator<Item = String>,
selector: SendSelector<S>,
merger: SendMerger<S>,
join: String,
) -> Self
pub fn new( targets: impl IntoIterator<Item = String>, selector: SendSelector<S>, merger: SendMerger<S>, join: String, ) -> Self
Construct a SendEdge from its parts. The target list is
deduplicated while preserving first-occurrence order — a
repeated declaration is a no-op (the deduped name still
dispatches once).
Sourcepub fn targets(&self) -> &[String]
pub fn targets(&self) -> &[String]
Borrow the declaration-ordered target list. Order matches
the names the operator passed to
crate::StateGraph::add_send_edges.
Sourcepub fn has_target(&self, name: &str) -> bool
pub fn has_target(&self, name: &str) -> bool
True when name is a declared dispatch target. O(1) via
the internal HashSet.