pub struct ModuleGraph {
pub crate_name: String,
/* private fields */
}Expand description
The complete dependency graph for a crate
Fields§
§crate_name: StringName of the crate
Implementations§
Source§impl ModuleGraph
impl ModuleGraph
Sourcepub fn add_module(&mut self, module: Module)
pub fn add_module(&mut self, module: Module)
Add a module to the graph
Sourcepub fn add_edge(&mut self, from: ModulePath, to: ModulePath, kind: EdgeKind)
pub fn add_edge(&mut self, from: ModulePath, to: ModulePath, kind: EdgeKind)
Add an edge between two modules (no self-edges allowed)
If an edge already exists between the same modules, ModDeclaration
takes precedence over UseImport.
Sourcepub fn edges(
&self,
) -> impl Iterator<Item = (&ModulePath, &ModulePath, EdgeKind)>
pub fn edges( &self, ) -> impl Iterator<Item = (&ModulePath, &ModulePath, EdgeKind)>
Iterate over all edges as (from, to, kind) tuples
Sourcepub fn exclude_tests_modules(&mut self)
pub fn exclude_tests_modules(&mut self)
Remove all tests modules and their associated edges from the graph
This removes any module whose path is “tests” or ends with ::tests,
along with any edges to or from those modules.
Source§impl ModuleGraph
impl ModuleGraph
Sourcepub fn to_mermaid(&self) -> String
pub fn to_mermaid(&self) -> String
Convert the graph to Mermaid flowchart syntax
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModuleGraph
impl RefUnwindSafe for ModuleGraph
impl Send for ModuleGraph
impl Sync for ModuleGraph
impl Unpin for ModuleGraph
impl UnwindSafe for ModuleGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more