pub struct DependencyGraph {
pub graph: DiGraph<GraphNode, GraphEdge>,
pub node_map: HashMap<String, NodeIndex>,
pub source_file: PathBuf,
/* private fields */
}Expand description
The dependency graph structure
Fields§
§graph: DiGraph<GraphNode, GraphEdge>The underlying petgraph
node_map: HashMap<String, NodeIndex>Node lookup by ID
source_file: PathBufSource file path
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the number of nodes
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get the number of edges
Sourcepub fn add_edge(&mut self, from: &str, to: &str, edge: GraphEdge) -> bool
pub fn add_edge(&mut self, from: &str, to: &str, edge: GraphEdge) -> bool
Add an edge between nodes
Sourcepub fn get_node_mut(&mut self, id: &str) -> Option<&mut GraphNode>
pub fn get_node_mut(&mut self, id: &str) -> Option<&mut GraphNode>
Get a mutable node by ID
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DependencyGraph
impl RefUnwindSafe for DependencyGraph
impl Send for DependencyGraph
impl Sync for DependencyGraph
impl Unpin for DependencyGraph
impl UnwindSafe for DependencyGraph
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more