pub struct DependencyGraph<'a> { /* private fields */ }
Expand description
Directed graph capturing dependencies between modules
Implementations§
source§impl<'a> DependencyGraph<'a>
impl<'a> DependencyGraph<'a>
sourcepub fn new(module_iter: impl IntoIterator<Item = &'a CompiledModule>) -> Self
pub fn new(module_iter: impl IntoIterator<Item = &'a CompiledModule>) -> Self
Construct a dependency graph from a set of modules
.
Panics if modules
contains duplicates or is not closed under the depedency relation
sourcepub fn compute_topological_order(
&self
) -> Result<impl Iterator<Item = &CompiledModule>>
pub fn compute_topological_order( &self ) -> Result<impl Iterator<Item = &CompiledModule>>
Return an iterator over the modules in self
in topological order–modules with least deps first.
Fails with an error if self
contains circular dependencies