pub struct CallGraph {
pub nodes: HashMap<FunctionKey, CallGraphNode>,
pub calls: HashMap<FunctionKey, HashSet<FunctionKey>>,
pub called_by: HashMap<FunctionKey, HashSet<FunctionKey>>,
}Expand description
The call graph for a set of files.
Fields§
§nodes: HashMap<FunctionKey, CallGraphNode>Function definitions: name → node.
calls: HashMap<FunctionKey, HashSet<FunctionKey>>Forward edges: function → set of functions it calls.
called_by: HashMap<FunctionKey, HashSet<FunctionKey>>Reverse edges: function → set of functions that call it.
Implementations§
Source§impl CallGraph
impl CallGraph
Sourcepub fn build(files: &[(PathBuf, String)]) -> Self
pub fn build(files: &[(PathBuf, String)]) -> Self
Build a call graph from a set of files and their contents.
Sourcepub fn keys_for_name(&self, name: &str) -> Vec<FunctionKey>
pub fn keys_for_name(&self, name: &str) -> Vec<FunctionKey>
Return stable function identities for a bare function name.
Sourcepub fn blast_radius(&self, changed_functions: &[String]) -> BlastRadius
pub fn blast_radius(&self, changed_functions: &[String]) -> BlastRadius
Compute the blast radius for a set of changed function names. Returns all transitive callers (upstream functions that depend on the changed ones).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CallGraph
impl RefUnwindSafe for CallGraph
impl Send for CallGraph
impl Sync for CallGraph
impl Unpin for CallGraph
impl UnsafeUnpin for CallGraph
impl UnwindSafe for CallGraph
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