Skip to main content

CodeGraph

Trait CodeGraph 

Source
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§

Source

fn children(&self, n_id: NodeId) -> Vec<NodeId>

n_id’s children, following both AST and CFG edges.

Source

fn parents(&self, n_id: NodeId) -> Vec<NodeId>

n_id’s parents, following both AST and CFG edges.

Source

fn ast_children(&self, n_id: NodeId) -> Vec<NodeId>

n_id’s children, following AST edges only.

Source

fn ast_parents(&self, n_id: NodeId) -> Vec<NodeId>

n_id’s parents, following AST edges only.

Source

fn cfg_children(&self, n_id: NodeId) -> Vec<NodeId>

n_id’s children, following CFG edges only.

Source

fn cfg_parents(&self, n_id: NodeId) -> Vec<NodeId>

n_id’s parents, following CFG edges only.

Source

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".

Implementors§