pub struct Graph {
pub nodes: HashMap<String, Node>,
pub edges: Vec<Edge>,
pub forward: HashMap<String, Vec<usize>>,
pub reverse: HashMap<String, Vec<usize>>,
}Fields§
§nodes: HashMap<String, Node>§edges: Vec<Edge>§forward: HashMap<String, Vec<usize>>§reverse: HashMap<String, Vec<usize>>Implementations§
Source§impl Graph
impl Graph
pub fn new() -> Self
pub fn add_node(&mut self, node: Node)
Sourcepub fn is_internal_edge(&self, edge: &Edge) -> bool
pub fn is_internal_edge(&self, edge: &Edge) -> bool
Returns true when the edge target is an included node in the graph.
pub fn add_edge(&mut self, edge: Edge)
Sourcepub fn included_nodes(&self) -> impl Iterator<Item = (&String, &Node)>
pub fn included_nodes(&self) -> impl Iterator<Item = (&String, &Node)>
Iterate over nodes that match include patterns.
Sourcepub fn filter_by_parsers(&self, parsers: &[String]) -> Graph
pub fn filter_by_parsers(&self, parsers: &[String]) -> Graph
Create a new graph containing only edges from the specified parsers. All nodes are preserved. Adjacency maps are rebuilt for the filtered edge set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
impl UnwindSafe for Graph
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