configbuilder-pattern-loader 0.1.0

configbuilder-pattern: loader domain, trait contract + tech-agnostic reference implementation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::ConfigError;

/// Topological dependency resolver for feature load ordering.
///
/// Implemented by [`crate::Topology`].
pub trait TopologyOps {
    /// Return a topological ordering of the provided names.
    ///
    /// `names` is the list of feature names; `requires[i]` is the slice of
    /// dependencies for `names[i]`.
    ///
    /// # Errors
    ///
    /// Returns [`ConfigError::Validation`] listing all nodes involved in a detected cycle.
    fn sort(&self, names: &[&str], requires: &[&[&str]]) -> Result<Vec<usize>, ConfigError>;
}