pub struct DiscoveryEngine<'a> { /* private fields */ }Expand description
Main discovery engine for pattern-based symbol search.
§Example
ⓘ
let engine = DiscoveryEngine::new(&code_graph, ®istry, None, None);
let query = DiscoveryQuery::symbol("*Config")
.kinds(vec![SymbolKind::Struct])
.with_relations();
let result = engine.execute(&query)?;
for symbol in result.iter() {
println!("{}: {:?}", symbol.path, symbol.kind);
}Implementations§
Source§impl<'a> DiscoveryEngine<'a>
impl<'a> DiscoveryEngine<'a>
Sourcepub fn new(
graph: &'a CodeGraphV2,
registry: &'a SymbolRegistry,
dataflow: Option<&'a DataFlowGraphV2>,
) -> DiscoveryEngine<'a>
pub fn new( graph: &'a CodeGraphV2, registry: &'a SymbolRegistry, dataflow: Option<&'a DataFlowGraphV2>, ) -> DiscoveryEngine<'a>
Create a new discovery engine.
Sourcepub fn set_typeflow(self, typeflow: &'a TypeFlowGraphV2) -> DiscoveryEngine<'a>
pub fn set_typeflow(self, typeflow: &'a TypeFlowGraphV2) -> DiscoveryEngine<'a>
Add TypeFlowGraphV2 to the engine.
Sourcepub fn execute(&self, query: &DiscoveryQuery) -> DiscoveryResult
pub fn execute(&self, query: &DiscoveryQuery) -> DiscoveryResult
Execute a discovery query.
Sourcepub fn find_exact(&self, name: &str) -> DiscoveryResult
pub fn find_exact(&self, name: &str) -> DiscoveryResult
Find symbols by exact name.
Sourcepub fn find_glob(&self, pattern: &str) -> DiscoveryResult
pub fn find_glob(&self, pattern: &str) -> DiscoveryResult
Find symbols matching a glob pattern.
Sourcepub fn find_implementations(&self, trait_id: SymbolId) -> Vec<SymbolId>
pub fn find_implementations(&self, trait_id: SymbolId) -> Vec<SymbolId>
Find all implementations of a trait.
Sourcepub fn find_callers(&self, func_id: SymbolId) -> Vec<SymbolId>
pub fn find_callers(&self, func_id: SymbolId) -> Vec<SymbolId>
Find all callers of a function.
Sourcepub fn find_callees(&self, func_id: SymbolId) -> Vec<SymbolId>
pub fn find_callees(&self, func_id: SymbolId) -> Vec<SymbolId>
Find all callees of a function.
Auto Trait Implementations§
impl<'a> Freeze for DiscoveryEngine<'a>
impl<'a> RefUnwindSafe for DiscoveryEngine<'a>
impl<'a> Send for DiscoveryEngine<'a>
impl<'a> Sync for DiscoveryEngine<'a>
impl<'a> Unpin for DiscoveryEngine<'a>
impl<'a> UnsafeUnpin for DiscoveryEngine<'a>
impl<'a> UnwindSafe for DiscoveryEngine<'a>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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