configbuilder_pattern_loader/topology_ops.rs
1use crate::ConfigError;
2
3/// Topological dependency resolver for feature load ordering.
4///
5/// Implemented by [`crate::Topology`].
6pub trait TopologyOps {
7 /// Return a topological ordering of the provided names.
8 ///
9 /// `names` is the list of feature names; `requires[i]` is the slice of
10 /// dependencies for `names[i]`.
11 ///
12 /// # Errors
13 ///
14 /// Returns [`ConfigError::Validation`] listing all nodes involved in a detected cycle.
15 fn sort(&self, names: &[&str], requires: &[&[&str]]) -> Result<Vec<usize>, ConfigError>;
16}