feat: add '--uses' ie: cargo modules structure --no-fns --no-traits --no-types --uses
While --uses might not seems as logical under the structure sub-command as the dependencies, I think it could be useful for some people.
On the project I am working on, dependencies even with --focus-on produces graphs that are far too busy to be usable. (I have tried many of the --layout options)
So, I think being able to see the uses in the structure view would be quiet useful.
Thank you for making cargo-modules, it is really great!
Ho Cameron,
do you have a sort of sketch of how you would envision such uses to be visualized via the structure sub-command?
This is something I want as well. My use case is when I start to read an existing codebase and want to identify the "leaves" of dependency forest. "owns" relationship is already reflected by the directory structure of the code.
But, I don't think such an output can be a tree form like structure command. One way to achieve something like this is by topologically sorting the "use"-dependency graph. That'd be just a list.
A more elaborate presentation would be a layered graph. The leaf nodes are on the top layer. Then, nodes that are directly dependent on them are on the next layer. And so forth. Towards the bottom, modules are increasingly more dependent on other modules. That will be similar to the "tech tree" presentation on video games. We may need to deal with cycles by breaking cycles favoring certain edges or by treating cycles as groups (aka Tarjan's strongly-connected component).
