pub struct DependencyGraph {
pub nodes: Vec<GraphNode>,
pub edges: Vec<GraphEdge>,
pub topo_order: Vec<String>,
}Expand description
The dependency graph, constructed once during build() and immutable thereafter.
Fields§
§nodes: Vec<GraphNode>All nodes indexed by record key.
edges: Vec<GraphEdge>All edges (both internal and external).
topo_order: Vec<String>Topological order of record keys (transforms come after their inputs).
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn build_and_validate(nodes: Vec<GraphNode>) -> DbResult<Self>
pub fn build_and_validate(nodes: Vec<GraphNode>) -> DbResult<Self>
Construct and validate the dependency graph from registered records.
This builds a complete DependencyGraph with nodes, edges, and topological order.
The graph is immutable after construction and can be used for introspection.
§Arguments
nodes- OneGraphNodeper registered record (origin, buffer, etc.)
§Returns
Ok(DependencyGraph)- The complete, validated graphErr(DbError::TransformInputNotFound)- If a transform references a missing recordErr(DbError::CyclicDependency)- If the transform edges form a cycle
Sourcepub fn build_and_validate_seeded(
nodes: Vec<GraphNode>,
seed: Option<u64>,
) -> DbResult<Self>
pub fn build_and_validate_seeded( nodes: Vec<GraphNode>, seed: Option<u64>, ) -> DbResult<Self>
build_and_validate, with a seed that
permutes the start order.
Without a seed, records ready at once are taken in registration order. With one, the next record is drawn from all ready records by a seeded PRNG, so different seeds explore different valid orders and the same seed replays one. Either way every record comes after its inputs.
Sourcepub fn topo_order(&self) -> &[String]
pub fn topo_order(&self) -> &[String]
Get the topological order