Skip to main content

Module dependencies

Module dependencies 

Source
Expand description

Walk package’s module dependencies

Within a package, each Module will depends on other Modules. The aim of the dependencies module is to provide a way to sort the modules in a dependent way, allowing parallel action on which module. We will also find out existing cyclic dependencies and return all of them as error.

We are currently using the excellent petgraph crate for sorting our dependencies and discovering cycle. We currently use the results of the cycle discovery to drive how we execute the processing. If we want to introduce parallel processing of the different module, we will have to be a bit more thorough because we currently don’t have any information at processing time to know when to block the check of some modules. We don’t know how we will do most of that processing, so it’s a bit premature to actually implement multi threading here. Let’s see how it goes first on a single thread and we can revisit this decision later on.

Structs§

Cycle
A dependency cycle: one loop through a strongly-connected component of the import graph, alongside the import that created each edge between consecutive modules (wrapping around to the first), and any component member that loop does not pass through.
CycleEdge
One import that forms an edge of a dependency cycle.
ModuleWalker

Enums§

Error
Outcome
What a checker hands ModuleWalker::check_in_order back for one module.