Skip to main content

EntityResolver

Trait EntityResolver 

Source
pub trait EntityResolver:
    Send
    + Sync
    + 'static {
    // Required method
    fn resolve(
        &self,
        scope: &Scope,
        entity: &str,
    ) -> impl Future<Output = Result<Resolution, ResolveError>> + Send;
}
Expand description

Maps an extracted entity string to a canonical graph node.

Implementations decide whether a candidate is an existing node or a new one, always confined to the candidate’s Scope. Swapping one implementation for another (exact-string, embedding, or a future ANN-backed impl) requires no caller change, which is what lets the benchmark compare them.

Required Methods§

Source

fn resolve( &self, scope: &Scope, entity: &str, ) -> impl Future<Output = Result<Resolution, ResolveError>> + Send

Resolves entity within scope to an existing or new node.

§Errors

Returns ResolveError::Catalog when candidate retrieval fails and ResolveError::Embed when the embedding model fails.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§