pub struct SourceCodeGraph {
pub nodes: Vec<GraphNode>,
pub edges: Vec<GraphEdge>,
pub metadata: HashMap<String, String>,
}Expand description
Aggregate graph describing the full software project topology.
Fields§
§nodes: Vec<GraphNode>All nodes that make up the graph.
edges: Vec<GraphEdge>All edges that connect nodes in the graph.
metadata: HashMap<String, String>Arbitrary metadata about the entire graph snapshot.
Implementations§
Source§impl SourceCodeGraph
impl SourceCodeGraph
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Returns the number of nodes currently tracked.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Returns the number of edges currently tracked.
Sourcepub fn to_petgraph(
&self,
) -> (StableDiGraph<GraphNode, String>, HashMap<NodeId, NodeIndex>)
pub fn to_petgraph( &self, ) -> (StableDiGraph<GraphNode, String>, HashMap<NodeId, NodeIndex>)
Convert to petgraph StableDiGraph for visualization/analysis. Returns the graph and a mapping from NodeIndex to NodeId.
Trait Implementations§
Source§impl Clone for SourceCodeGraph
impl Clone for SourceCodeGraph
Source§fn clone(&self) -> SourceCodeGraph
fn clone(&self) -> SourceCodeGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceCodeGraph
impl Debug for SourceCodeGraph
Source§impl Default for SourceCodeGraph
impl Default for SourceCodeGraph
Source§fn default() -> SourceCodeGraph
fn default() -> SourceCodeGraph
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SourceCodeGraph
impl<'de> Deserialize<'de> for SourceCodeGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SourceCodeGraph
impl RefUnwindSafe for SourceCodeGraph
impl Send for SourceCodeGraph
impl Sync for SourceCodeGraph
impl Unpin for SourceCodeGraph
impl UnsafeUnpin for SourceCodeGraph
impl UnwindSafe for SourceCodeGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more