pub struct SharedStateSubgraph { /* private fields */ }Expand description
A finite, shared-state subgraph template with explicit return ports.
Pure terminal nodes in the template are symbolic return ports, not executable
nodes. Every other node executes normally and communicates through the pinned
state/update schema and reducer. Returns never silently discard terminal
output: an executable body node cannot declare terminal.
Templates must be acyclic. Use GraphSubgraphCall::bounded_loop for an
explicitly bounded repeat, with a parent route for exhaustion. An already
composed acyclic graph can itself become a template, allowing static nesting.
Implementations§
Sourcepub fn new(graph: CompiledGraph) -> Result<Self, GraphCompositionError>
pub fn new(graph: CompiledGraph) -> Result<Self, GraphCompositionError>
Validates a compiled template before it can be composed.
§Errors
Rejects mixed executable/terminal nodes, entry return ports, cycles, absent return ports, and paths exceeding the template’s step ceiling.
Sourcepub fn graph(&self) -> &CompiledGraph
pub fn graph(&self) -> &CompiledGraph
Returns the exact original template, including its symbolic ports.
Sourcepub fn return_ports(&self) -> impl ExactSizeIterator<Item = &NodeId>
pub fn return_ports(&self) -> impl ExactSizeIterator<Item = &NodeId>
Returns symbolic ports in canonical identity order.