Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tamaroning/src-graph
cargo subcommand which shows dependencies between user defined data types
https://github.com/tamaroning/src-graph
rust-lang
Last synced: about 1 month ago
JSON representation
cargo subcommand which shows dependencies between user defined data types
- Host: GitHub
- URL: https://github.com/tamaroning/src-graph
- Owner: tamaroning
- Created: 2022-06-25T13:32:12.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-06-26T10:43:15.000Z (over 2 years ago)
- Last Synced: 2024-11-21T23:09:26.142Z (2 months ago)
- Topics: rust-lang
- Language: Rust
- Homepage: https://crates.io/crates/src-graph
- Size: 83 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# src-graph
Cargo subcommand which shows user-defined data type dependencies.If you found a bug, please open an issue.
![screenshot1](screenshot1.png)
# Requirement
- Cargo
- Graphviz (for generating an image)# Install
From crates.io
```
$ cargo install src-graph
```From source code
```
$ git clone https://github.com/tamaroning/src-graph.git
$ cd src-graph
$ cagro install --path .
```# Usage
Run in your rust project
```
$ cargo src-graph
```then generate an image from the dot file
```
$ dot -Tpng -o ./.src_graph/adt_deps.png ./.src_graph/adt_deps.dot
```# Example
The code below
```rust
use std::collections::HashMap;struct S {
a: Vec,
b: HashMap,
c: mod_A::S3,
}struct S2 {
a: mod_A::S3,
}mod mod_A {
pub struct S3 {
a: Box>,
}
}
```generates this graph:
![example1](example1.png)