Skip to main content

topological_sort

Function topological_sort 

Source
pub fn topological_sort(component_ids: &[String]) -> Result<Vec<String>, String>
Expand description

Sort component IDs in topological order so dependencies are installed before dependents.

Uses Kahn’s algorithm (BFS-based topological sort).

§Validation Assertions

  • VAL-INSTALL-048: Dependency graph is acyclic
  • VAL-INSTALL-049: installer.rs respects dependency ordering

§Returns

Ok(sorted_ids) on success, Err(cycle_description) if a cycle is detected.