pub trait CodeGraph {
// Required methods
fn children(&self, n_id: NodeId) -> Vec<NodeId>;
fn parents(&self, n_id: NodeId) -> Vec<NodeId>;
fn ast_children(&self, n_id: NodeId) -> Vec<NodeId>;
fn ast_parents(&self, n_id: NodeId) -> Vec<NodeId>;
fn cfg_children(&self, n_id: NodeId) -> Vec<NodeId>;
fn cfg_parents(&self, n_id: NodeId) -> Vec<NodeId>;
fn label_type(&self, n_id: NodeId) -> Option<&str>;
}Expand description
A graph with both AST and control-flow adjacency over the same nodes.
Required Methods§
Sourcefn children(&self, n_id: NodeId) -> Vec<NodeId>
fn children(&self, n_id: NodeId) -> Vec<NodeId>
n_id’s children, following both AST and CFG edges.
Sourcefn parents(&self, n_id: NodeId) -> Vec<NodeId>
fn parents(&self, n_id: NodeId) -> Vec<NodeId>
n_id’s parents, following both AST and CFG edges.
Sourcefn ast_children(&self, n_id: NodeId) -> Vec<NodeId>
fn ast_children(&self, n_id: NodeId) -> Vec<NodeId>
n_id’s children, following AST edges only.
Sourcefn ast_parents(&self, n_id: NodeId) -> Vec<NodeId>
fn ast_parents(&self, n_id: NodeId) -> Vec<NodeId>
n_id’s parents, following AST edges only.
Sourcefn cfg_children(&self, n_id: NodeId) -> Vec<NodeId>
fn cfg_children(&self, n_id: NodeId) -> Vec<NodeId>
n_id’s children, following CFG edges only.
Sourcefn cfg_parents(&self, n_id: NodeId) -> Vec<NodeId>
fn cfg_parents(&self, n_id: NodeId) -> Vec<NodeId>
n_id’s parents, following CFG edges only.
Sourcefn label_type(&self, n_id: NodeId) -> Option<&str>
fn label_type(&self, n_id: NodeId) -> Option<&str>
n_id’s syntax-kind label, when the graph has one for it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".