pub struct ContextGraph {
pub graph: DiGraph<Node, EdgeKind>,
pub symbol_to_node: HashMap<SymbolId, NodeIndex>,
}Expand description
Context Graph - the core data structure
Fields§
§graph: DiGraph<Node, EdgeKind>The directed graph of nodes and edges
symbol_to_node: HashMap<SymbolId, NodeIndex>Mapping from symbol to node index
Implementations§
Source§impl ContextGraph
impl ContextGraph
pub fn new() -> Self
pub fn add_node(&mut self, symbol: SymbolId, node: Node) -> NodeIndex
pub fn add_edge(&mut self, source: NodeIndex, target: NodeIndex, kind: EdgeKind)
pub fn get_node_by_symbol(&self, symbol: &str) -> Option<NodeIndex>
pub fn node(&self, idx: NodeIndex) -> &Node
pub fn neighbors( &self, idx: NodeIndex, ) -> impl Iterator<Item = (NodeIndex, &EdgeKind)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContextGraph
impl RefUnwindSafe for ContextGraph
impl Send for ContextGraph
impl Sync for ContextGraph
impl Unpin for ContextGraph
impl UnsafeUnpin for ContextGraph
impl UnwindSafe for ContextGraph
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