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 nodes_by_type: BTreeMap<SyntaxKind, Vec<NodeId>>,
}Fields§
§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>>§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_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§fn clone(&self) -> SyntaxGraph
fn clone(&self) -> SyntaxGraph
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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
Source§fn default() -> SyntaxGraph
fn default() -> SyntaxGraph
Returns the “default value” for a type. Read more
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