cargo-graphmod

Crates.iocargo-graphmod
lib.rscargo-graphmod
version1.1.0
sourcesrc
created_at2023-07-08 13:44:10.485816
updated_at2023-12-23 12:59:42.178627
descriptionA cli utility to graph the dependencies between the modules of a package in the dot/graphviz format.
homepage
repositoryhttps://github.com/thomas-huegel/cargo-graphmod
max_upload_size
id911474
size117,532
Thomas Hügel (thomas-huegel)

documentation

README

Cargo Graphmod

A cargo subcommand for building Graphviz DOT files of dependency graphs between the modules of a package.

Prerequisites

Installing

cargo-graphmod can be installed with cargo install:

cargo install cargo-graphmod

Usage

cd my_rust_package
cargo graphmod | tred | dot -Tsvg > modules.svg
  • Assumptions:

    • You should run the command from the root of your project (just above src).
    • By default, the package name (as defined in 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.

Known limitations

  • 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.

License

cargo-graphmod is released under the terms of the GPLv3 license.

Cargo Graphmod's graph

cargo-graphmod

Other example

web_app

Commit count: 55

cargo fmt