pub struct CallGraph {
pub project_root: String,
pub edges: Vec<CallEdge>,
pub file_hashes: HashMap<String, String>,
}Fields§
§project_root: String§edges: Vec<CallEdge>§file_hashes: HashMap<String, String>Implementations§
Source§impl CallGraph
impl CallGraph
pub fn new(project_root: &str) -> Self
pub fn build_parallel( index: &ProjectIndex, progress: Option<(&AtomicUsize, &AtomicUsize)>, ) -> Self
pub fn build_incremental_parallel( index: &ProjectIndex, previous: &CallGraph, progress: Option<(&AtomicUsize, &AtomicUsize)>, ) -> Self
Sourcepub fn get_or_start_build(
project_root: &str,
index: Arc<ProjectIndex>,
) -> Result<Arc<CallGraph>, BuildProgress>
pub fn get_or_start_build( project_root: &str, index: Arc<ProjectIndex>, ) -> Result<Arc<CallGraph>, BuildProgress>
Returns the cached graph immediately, or None + starts a background build.
Sourcepub fn build_status() -> BuildProgress
pub fn build_status() -> BuildProgress
Returns current build status without starting anything.
Sourcepub fn invalidate()
pub fn invalidate()
Force-invalidate the cached result so next request triggers a rebuild.
pub fn build(index: &ProjectIndex) -> Self
pub fn build_incremental(index: &ProjectIndex, previous: &CallGraph) -> Self
pub fn callers_of(&self, symbol: &str) -> Vec<&CallEdge>
pub fn callees_of(&self, symbol: &str) -> Vec<&CallEdge>
Sourcepub fn bfs_callers(&self, symbol: &str, max_depth: usize) -> Vec<BfsNode>
pub fn bfs_callers(&self, symbol: &str, max_depth: usize) -> Vec<BfsNode>
BFS callers up to max_depth hops. Returns (symbol, file, line, depth) per node.
Sourcepub fn bfs_callees(&self, symbol: &str, max_depth: usize) -> Vec<BfsNode>
pub fn bfs_callees(&self, symbol: &str, max_depth: usize) -> Vec<BfsNode>
BFS callees up to max_depth hops. Returns (symbol, file, line, depth) per node.
Sourcepub fn find_call_path(&self, from: &str, to: &str) -> Option<Vec<PathHop>>
pub fn find_call_path(&self, from: &str, to: &str) -> Option<Vec<PathHop>>
Find shortest call path from from to to using BFS.
Returns None if no path exists (searched up to depth 10).
Find shortest call path from from to to using BFS.
Returns None if no path exists (searched up to depth 10).
Sourcepub fn transitive_caller_count(&self, symbol: &str, max_depth: usize) -> usize
pub fn transitive_caller_count(&self, symbol: &str, max_depth: usize) -> usize
Count unique transitive callers up to max_depth.
pub fn save(&self) -> Result<(), String>
pub fn load(project_root: &str) -> Option<Self>
pub fn load_or_build(project_root: &str, index: &ProjectIndex) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CallGraph
impl<'de> Deserialize<'de> for CallGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more