It sounds like you’re looking for something along the lines of cargo-graph, except instead of graphing how different crates depend on each other, you’re looking at the individual components inside the crate.
I’m not sure if there are any tools out there which can do something like that just yet, although one of the debug flags for
rustc may have what you want.
rustc -Z help I noticed this debug flag:
-Z dump-dep-graph -- dump the dependency graph to $RUST_DEP_GRAPH (default: /tmp/dep_graph.gv)
Just out of interest I tried this out on a fairly trivial project.
$ rustc --version
rustc 1.19.0-nightly (f4209651e 2017-05-05)
$ wc src/*.rs
69 180 1776 src/main.rs
$ cargo rustc -- -Z dump-dep-graph
$ wc dep_graph.dot dep_graph.txt
67778 371317 20343311 dep_graph.dot
39895 767941 11455694 dep_graph.txt
107673 1139258 31799005 total
$ dot -Tsvg dep_graph.dot > deps.svg
dot has been running for about 6 minutes and one of my cores is pinned at 100%, but when it’s done I’ll let you know if the graph is any use