#[non_exhaustive]pub struct SyntaxGraph {
pub nodes: BTreeMap<NodeId, SyntaxNode>,
pub edges: BTreeMap<NodeId, BTreeMap<NodeId, SyntaxEdge>>,
pub symbol_index: BTreeMap<String, BTreeMap<NodeId, Vec<NodeId>>>,
pub scope_parent: BTreeMap<NodeId, NodeId>,
pub sanitization_index: BTreeMap<String, BTreeMap<NodeId, Vec<SanitizationEvent>>>,
pub usage_index: BTreeMap<String, BTreeMap<NodeId, Vec<UsageEvent>>>,
pub subpath_index: BTreeMap<NodeId, Option<NodeId>>,
pub call_index: BTreeMap<String, Vec<NodeId>>,
pub nodes_by_type: BTreeMap<SyntaxKind, Vec<NodeId>>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.nodes: BTreeMap<NodeId, SyntaxNode>§edges: BTreeMap<NodeId, BTreeMap<NodeId, SyntaxEdge>>§symbol_index: BTreeMap<String, BTreeMap<NodeId, Vec<NodeId>>>§scope_parent: BTreeMap<NodeId, NodeId>§sanitization_index: BTreeMap<String, BTreeMap<NodeId, Vec<SanitizationEvent>>>§usage_index: BTreeMap<String, BTreeMap<NodeId, Vec<UsageEvent>>>§subpath_index: BTreeMap<NodeId, Option<NodeId>>§call_index: BTreeMap<String, Vec<NodeId>>Callee short name -> invocations of it, used to reach a method’s call sites.
nodes_by_type: BTreeMap<SyntaxKind, Vec<NodeId>>Implementations§
Source§impl SyntaxGraph
impl SyntaxGraph
pub fn new() -> Self
pub fn add_node(&mut self, id: NodeId, node: SyntaxNode)
pub fn register_sanitization( &mut self, symbol: &str, scope: NodeId, event: SanitizationEvent, )
pub fn register_call(&mut self, name: &str, invocation_id: NodeId)
pub fn register_usage(&mut self, symbol: &str, scope: NodeId, event: UsageEvent)
pub fn add_ast_edge(&mut self, from: NodeId, to: NodeId)
pub fn add_cfg_edge(&mut self, from: NodeId, to: NodeId)
pub fn finalize_symbol_index(&mut self)
pub fn remove_edge(&mut self, from: NodeId, to: NodeId)
Trait Implementations§
Source§impl Clone for SyntaxGraph
impl Clone for SyntaxGraph
Source§impl CodeGraph for SyntaxGraph
impl CodeGraph for SyntaxGraph
fn children(&self, n_id: NodeId) -> Vec<NodeId>
fn ast_children(&self, n_id: NodeId) -> Vec<NodeId>
fn parents(&self, n_id: NodeId) -> Vec<NodeId>
fn ast_parents(&self, n_id: NodeId) -> Vec<NodeId>
fn cfg_parents(&self, n_id: NodeId) -> Vec<NodeId>
fn cfg_children(&self, n_id: NodeId) -> Vec<NodeId>
fn label_type(&self, n_id: NodeId) -> Option<&str>
Source§impl Debug for SyntaxGraph
impl Debug for SyntaxGraph
Source§impl Default for SyntaxGraph
impl Default for SyntaxGraph
impl Eq for SyntaxGraph
Source§impl PartialEq for SyntaxGraph
impl PartialEq for SyntaxGraph
impl StructuralPartialEq for SyntaxGraph
Auto Trait Implementations§
impl Freeze for SyntaxGraph
impl RefUnwindSafe for SyntaxGraph
impl Send for SyntaxGraph
impl Sync for SyntaxGraph
impl Unpin for SyntaxGraph
impl UnsafeUnpin for SyntaxGraph
impl UnwindSafe for SyntaxGraph
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