pub struct PackGraph { /* private fields */ }Expand description
Fully-walked pack graph. Immutable post-construction.
Nodes are owned; callers borrow via PackGraph::nodes or the dedicated
lookup helpers.
Implementations§
Source§impl PackGraph
impl PackGraph
Sourcepub fn validate(&self) -> Result<(), Vec<PackValidationError>>
pub fn validate(&self) -> Result<(), Vec<PackValidationError>>
Run the default graph-validator set over self.
Mirrors PackManifest::validate_plan at the graph surface. Kept
here (rather than in tree::graph) so the tree module does not
depend on pack::validate; the dependency direction stays
validate -> tree only.
§Errors
Returns the aggregated error list when any graph validator flags a problem.
Source§impl PackGraph
impl PackGraph
Sourcepub fn children_of(&self, id: usize) -> impl Iterator<Item = &PackNode>
pub fn children_of(&self, id: usize) -> impl Iterator<Item = &PackNode>
Iterate the Child-kind neighbours of id (in insertion order).
Sourcepub fn depends_on_of(&self, id: usize) -> impl Iterator<Item = &PackNode>
pub fn depends_on_of(&self, id: usize) -> impl Iterator<Item = &PackNode>
Iterate the DependsOn-kind neighbours of id.
Sourcepub fn find_by_name(&self, name: &str) -> Option<&PackNode>
pub fn find_by_name(&self, name: &str) -> Option<&PackNode>
Find a node by its manifest name. Returns the first match in insertion order; names are not guaranteed unique across a graph, though per-pack validators may reject duplicates in future slices.