pub trait CodeGraph: Send + Sync {
// Required methods
fn neighborhood(&self, symbol: &str) -> Option<Neighborhood>;
fn resolve_in_file(&self, file: &str, name: &str) -> Option<SymbolRef>;
fn symbol_names(&self) -> Vec<String>;
}Expand description
Read-only view over the code graph. Implementations must be Send + Sync
so they can be shared across async task boundaries.
Required Methods§
Sourcefn neighborhood(&self, symbol: &str) -> Option<Neighborhood>
fn neighborhood(&self, symbol: &str) -> Option<Neighborhood>
Returns the neighborhood of the first symbol matching symbol, or None
if the symbol is not in the index.
Sourcefn resolve_in_file(&self, file: &str, name: &str) -> Option<SymbolRef>
fn resolve_in_file(&self, file: &str, name: &str) -> Option<SymbolRef>
Returns the first symbol named name defined in file, or None.
Sourcefn symbol_names(&self) -> Vec<String>
fn symbol_names(&self) -> Vec<String>
Returns the names of every symbol currently in the index.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".