Crates.io | cargo-graphmod |
lib.rs | cargo-graphmod |
version | 1.1.0 |
source | src |
created_at | 2023-07-08 13:44:10.485816 |
updated_at | 2023-12-23 12:59:42.178627 |
description | A cli utility to graph the dependencies between the modules of a package in the dot/graphviz format. |
homepage | |
repository | https://github.com/thomas-huegel/cargo-graphmod |
max_upload_size | |
id | 911474 |
size | 117,532 |
A cargo
subcommand for building Graphviz DOT files of dependency graphs between the modules of a package.
You need to install Graphviz.
cargo-graphmod
can be installed with cargo install
:
cargo install cargo-graphmod
cd my_rust_package
cargo graphmod | tred | dot -Tsvg > modules.svg
Assumptions:
src
).Cargo.toml
) is supposed to be the directory name. Otherwise pass it as argument: cargo graphmod a_different_name
.Use tred
if you want the transitive reduction of the graph.
You can export to a lot of different formats.
Detects only dependencies introduced by the use
keyword.
Detects only dependencies before the first #[cfg(test)]
(in order to eliminate the dependencies from unit tests).
Works best when there is a bijection between modules and files / directories.
cargo-graphmod
is released under the terms of the GPLv3 license.