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§
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>>
Sourcefn direct_callers_bounded(
&self,
targets: &[(String, String)],
limit: usize,
) -> Result<(HashMap<(String, String), Vec<StoreCallSite>>, bool, usize)>
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.
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§
Sourcefn nodes_for_stored(&self, file: &str, symbol: &str) -> Result<Vec<StoreNode>>
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.
Sourcefn stored_content_hash(&self, _file: &str) -> Result<Option<String>>
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.
fn direct_callers_for_symbols( &self, targets: &[(String, String)], ) -> Result<HashMap<(String, String), Vec<StoreCallSite>>>
Sourcefn ref_sites_named(
&self,
kind: &str,
short_name: &str,
limit: usize,
) -> Result<Vec<StoreRefSite>>
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.
Sourcefn macro_template_calls_of(
&self,
node: &StoreNode,
) -> Result<Vec<StoreUnresolvedCall>>
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.
Sourcefn unresolved_method_sites_named(
&self,
name: &str,
language: LangId,
) -> Result<Vec<StoreRefSite>>
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.
Sourcefn unresolved_call_sites_named(
&self,
name: &str,
language: LangId,
include_tests: bool,
limit: usize,
) -> Result<(usize, Vec<StoreRefSite>)>
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".