Skip to main content

CallGraphRead

Trait CallGraphRead 

Source
pub trait CallGraphRead {
Show 31 methods // Required methods fn project_root(&self) -> &Path; fn project_key(&self) -> &str; fn sqlite_path(&self) -> &Path; fn is_current(&self) -> bool; fn edge_snapshot(&self) -> Result<BTreeSet<StoredEdge>>; fn indexed_file_count(&self) -> Result<usize>; fn node_for(&self, file_rel: &Path, symbol: &str) -> Result<StoreNode>; fn nodes_for(&self, file_rel: &Path, symbol: &str) -> Result<Vec<StoreNode>>; fn nodes_matching(&self, symbol: &str) -> Result<Vec<StoreNode>>; fn direct_callers_of( &self, file_rel: &Path, symbol: &str, ) -> Result<Vec<StoreCallSite>>; fn direct_caller_counts_of( &self, targets: &[(String, String)], ) -> Result<HashMap<(String, String), usize>>; fn direct_callers_bounded( &self, targets: &[(String, String)], limit: usize, ) -> Result<(HashMap<(String, String), Vec<StoreCallSite>>, bool, usize)>; fn outgoing_calls_for_symbols( &self, sources: &[(String, String)], ) -> Result<HashMap<(String, String), Vec<StoreCallSite>>>; fn callers_of( &self, file_rel: &Path, symbol: &str, depth: usize, ) -> Result<StoreCallersResult>; fn impact_of( &self, file_rel: &Path, symbol: &str, depth: usize, ) -> Result<StoreImpactResult>; fn outgoing_calls_of(&self, node: &StoreNode) -> Result<Vec<StoreCallSite>>; fn resolved_self_calls_of( &self, node: &StoreNode, ) -> Result<Vec<StoreCallSite>>; fn unresolved_calls_of( &self, node: &StoreNode, ) -> Result<Vec<StoreUnresolvedCall>>; fn call_tree( &self, file_rel: &Path, symbol: &str, depth: usize, ) -> Result<CallTreeNode>; fn trace_to( &self, file_rel: &Path, symbol: &str, max_depth: usize, ) -> Result<TraceToResult>; fn trace_to_symbol_candidates( &self, to_symbol: &str, ) -> Result<Vec<TraceToSymbolCandidate>>; fn trace_to_symbol( &self, file_rel: &Path, symbol: &str, to_symbol: &str, to_file: Option<&Path>, max_depth: usize, ) -> Result<TraceToSymbolResult>; // Provided methods fn nodes_for_stored( &self, file: &str, symbol: &str, ) -> Result<Vec<StoreNode>> { ... } fn stored_content_hash(&self, _file: &str) -> Result<Option<String>> { ... } fn direct_callers_for_symbols( &self, targets: &[(String, String)], ) -> Result<HashMap<(String, String), Vec<StoreCallSite>>> { ... } fn ref_sites_named( &self, kind: &str, short_name: &str, limit: usize, ) -> Result<Vec<StoreRefSite>> { ... } fn macro_template_calls_of( &self, node: &StoreNode, ) -> Result<Vec<StoreUnresolvedCall>> { ... } fn unresolved_method_sites_named( &self, name: &str, language: LangId, ) -> Result<Vec<StoreRefSite>> { ... } fn unresolved_call_sites_named( &self, name: &str, language: LangId, include_tests: bool, limit: usize, ) -> Result<(usize, Vec<StoreRefSite>)> { ... } fn unresolved_call_site_count( &self, language: LangId, include_tests: bool, ) -> Result<usize> { ... } fn unresolved_call_site_count_named( &self, name: &str, language: LangId, include_tests: bool, ) -> Result<usize> { ... }
}

Required Methods§

Source

fn project_root(&self) -> &Path

Source

fn project_key(&self) -> &str

Source

fn sqlite_path(&self) -> &Path

Source

fn is_current(&self) -> bool

Source

fn edge_snapshot(&self) -> Result<BTreeSet<StoredEdge>>

Source

fn indexed_file_count(&self) -> Result<usize>

Source

fn node_for(&self, file_rel: &Path, symbol: &str) -> Result<StoreNode>

Source

fn nodes_for(&self, file_rel: &Path, symbol: &str) -> Result<Vec<StoreNode>>

Source

fn nodes_matching(&self, symbol: &str) -> Result<Vec<StoreNode>>

Source

fn direct_callers_of( &self, file_rel: &Path, symbol: &str, ) -> Result<Vec<StoreCallSite>>

Source

fn direct_caller_counts_of( &self, targets: &[(String, String)], ) -> Result<HashMap<(String, String), usize>>

Source

fn direct_callers_bounded( &self, targets: &[(String, String)], limit: usize, ) -> Result<(HashMap<(String, String), Vec<StoreCallSite>>, bool, usize)>

Fetch at most limit caller sites, reporting whether more were found. Stop in the edge iterator, before constructing a site beyond the limit.

Source

fn outgoing_calls_for_symbols( &self, sources: &[(String, String)], ) -> Result<HashMap<(String, String), Vec<StoreCallSite>>>

Source

fn callers_of( &self, file_rel: &Path, symbol: &str, depth: usize, ) -> Result<StoreCallersResult>

Source

fn impact_of( &self, file_rel: &Path, symbol: &str, depth: usize, ) -> Result<StoreImpactResult>

Source

fn outgoing_calls_of(&self, node: &StoreNode) -> Result<Vec<StoreCallSite>>

Source

fn resolved_self_calls_of(&self, node: &StoreNode) -> Result<Vec<StoreCallSite>>

Source

fn unresolved_calls_of( &self, node: &StoreNode, ) -> Result<Vec<StoreUnresolvedCall>>

Source

fn call_tree( &self, file_rel: &Path, symbol: &str, depth: usize, ) -> Result<CallTreeNode>

Source

fn trace_to( &self, file_rel: &Path, symbol: &str, max_depth: usize, ) -> Result<TraceToResult>

Source

fn trace_to_symbol_candidates( &self, to_symbol: &str, ) -> Result<Vec<TraceToSymbolCandidate>>

Source

fn trace_to_symbol( &self, file_rel: &Path, symbol: &str, to_symbol: &str, to_file: Option<&Path>, max_depth: usize, ) -> Result<TraceToSymbolResult>

Provided Methods§

Source

fn nodes_for_stored(&self, file: &str, symbol: &str) -> Result<Vec<StoreNode>>

nodes_for for a file path this store returned (store-relative and already resolved), without resolving it against the filesystem again. Graph walks call this once per visited node.

Source

fn stored_content_hash(&self, _file: &str) -> Result<Option<String>>

The indexed content hash for a path returned by this store, or None when unknown. Compare before pairing stored positions with live text.

Source

fn direct_callers_for_symbols( &self, targets: &[(String, String)], ) -> Result<HashMap<(String, String), Vec<StoreCallSite>>>

Source

fn ref_sites_named( &self, kind: &str, short_name: &str, limit: usize, ) -> Result<Vec<StoreRefSite>>

Raw ref rows of kind whose short name is short_name, resolved or not, at most limit of them in file and line order. callers uses it to find macro invocations and macro facts by name. Stores that keep no such rows answer with none.

Source

fn macro_template_calls_of( &self, node: &StoreNode, ) -> Result<Vec<StoreUnresolvedCall>>

The calls written inside the macro_rules! template that node, a macro owner (name!), defines, resolved or not, in source order. call_tree and trace_to_symbol follow them by name, as callers lists them. Stores that keep no such rows answer with none.

Source

fn unresolved_method_sites_named( &self, name: &str, language: LangId, ) -> Result<Vec<StoreRefSite>>

Unbound receiver calls of the written member name, excluding sites that already have a supplemental edge. An empty reverse graph cannot prove these calls do not reach the queried method.

Source

fn unresolved_call_sites_named( &self, name: &str, language: LangId, include_tests: bool, limit: usize, ) -> Result<(usize, Vec<StoreRefSite>)>

Count all unresolved invocation spans with this name and return up to limit locations, ordered by file and source position. Unlike the general warning count, this total is exact and respects the test filter.

Source

fn unresolved_call_site_count( &self, language: LangId, include_tests: bool, ) -> Result<usize>

Count unresolved invocation sites, stopping at UNRESOLVED_CALL_SITE_COUNT_LIMIT. A count at the limit is a lower bound, not an exact total.

Source

fn unresolved_call_site_count_named( &self, name: &str, language: LangId, include_tests: bool, ) -> Result<usize>

Count distinct (caller file, byte start, byte end) spans with this short name, including bare imported calls. The test filter and SQL count limit match the unnamed count.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: CallGraphRead + ?Sized> CallGraphRead for Arc<T>

Source§

fn stored_content_hash(&self, file: &str) -> Result<Option<String>>

Source§

fn project_root(&self) -> &Path

Source§

fn project_key(&self) -> &str

Source§

fn sqlite_path(&self) -> &Path

Source§

fn is_current(&self) -> bool

Source§

fn edge_snapshot(&self) -> Result<BTreeSet<StoredEdge>>

Source§

fn indexed_file_count(&self) -> Result<usize>

Source§

fn node_for(&self, file_rel: &Path, symbol: &str) -> Result<StoreNode>

Source§

fn nodes_for(&self, file_rel: &Path, symbol: &str) -> Result<Vec<StoreNode>>

Source§

fn nodes_for_stored(&self, file: &str, symbol: &str) -> Result<Vec<StoreNode>>

Source§

fn nodes_matching(&self, symbol: &str) -> Result<Vec<StoreNode>>

Source§

fn direct_callers_of( &self, file_rel: &Path, symbol: &str, ) -> Result<Vec<StoreCallSite>>

Source§

fn direct_callers_for_symbols( &self, targets: &[(String, String)], ) -> Result<HashMap<(String, String), Vec<StoreCallSite>>>

Source§

fn direct_caller_counts_of( &self, targets: &[(String, String)], ) -> Result<HashMap<(String, String), usize>>

Source§

fn direct_callers_bounded( &self, targets: &[(String, String)], limit: usize, ) -> Result<(HashMap<(String, String), Vec<StoreCallSite>>, bool, usize)>

Source§

fn callers_of( &self, file_rel: &Path, symbol: &str, depth: usize, ) -> Result<StoreCallersResult>

Source§

fn impact_of( &self, file_rel: &Path, symbol: &str, depth: usize, ) -> Result<StoreImpactResult>

Source§

fn outgoing_calls_of(&self, node: &StoreNode) -> Result<Vec<StoreCallSite>>

Source§

fn outgoing_calls_for_symbols( &self, sources: &[(String, String)], ) -> Result<HashMap<(String, String), Vec<StoreCallSite>>>

Source§

fn resolved_self_calls_of(&self, node: &StoreNode) -> Result<Vec<StoreCallSite>>

Source§

fn unresolved_calls_of( &self, node: &StoreNode, ) -> Result<Vec<StoreUnresolvedCall>>

Source§

fn ref_sites_named( &self, kind: &str, short_name: &str, limit: usize, ) -> Result<Vec<StoreRefSite>>

Source§

fn macro_template_calls_of( &self, node: &StoreNode, ) -> Result<Vec<StoreUnresolvedCall>>

Source§

fn unresolved_method_sites_named( &self, name: &str, language: LangId, ) -> Result<Vec<StoreRefSite>>

Source§

fn unresolved_call_site_count( &self, language: LangId, include_tests: bool, ) -> Result<usize>

Source§

fn unresolved_call_sites_named( &self, name: &str, language: LangId, include_tests: bool, limit: usize, ) -> Result<(usize, Vec<StoreRefSite>)>

Source§

fn unresolved_call_site_count_named( &self, name: &str, language: LangId, include_tests: bool, ) -> Result<usize>

Source§

fn call_tree( &self, file_rel: &Path, symbol: &str, depth: usize, ) -> Result<CallTreeNode>

Source§

fn trace_to( &self, file_rel: &Path, symbol: &str, max_depth: usize, ) -> Result<TraceToResult>

Source§

fn trace_to_symbol_candidates( &self, to_symbol: &str, ) -> Result<Vec<TraceToSymbolCandidate>>

Source§

fn trace_to_symbol( &self, file_rel: &Path, symbol: &str, to_symbol: &str, to_file: Option<&Path>, max_depth: usize, ) -> Result<TraceToSymbolResult>

Implementors§