pub struct Graph { /* private fields */ }Expand description
A compiled, immutable, thread-safe graph. Cheap to clone (Arc internals).
Obtain via GraphBuilder::compile. The executor drives a Graph;
graphs are frozen so topology can never drift mid-run.
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn entry_point(&self) -> &str
pub fn entry_point(&self) -> &str
The entry-point node name.
Sourcepub fn node_names(&self) -> impl Iterator<Item = &str>
pub fn node_names(&self) -> impl Iterator<Item = &str>
All registered node names.
Sourcepub fn outgoing_edges(&self, from: &str) -> Vec<&Edge>
pub fn outgoing_edges(&self, from: &str) -> Vec<&Edge>
All edges originating at from (static and conditional).
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of registered nodes.
Sourcepub fn topology_hash(&self) -> String
pub fn topology_hash(&self) -> String
SHA-256 content hash of the graph’s topology: the sorted node names
and the sorted edge descriptors (from>to for static edges,
from>? for conditional routers).
Stamped into crate::record::CheckpointHeader::graph_hash so replay
can detect that a checkpoint and the graph about to resume it
disagree structurally. It is deliberately a topology hash: node
bodies are opaque closures/trait objects, so semantic changes inside
a node cannot be detected here — that is what the application-level
graph_version (set via RunConfig::with_graph_version) is for.