pub struct Engine { /* private fields */ }Implementations§
Source§impl Engine
impl Engine
Sourcepub async fn abstracts(&self, works: &[&SourceRecord]) -> AbstractsReport
pub async fn abstracts(&self, works: &[&SourceRecord]) -> AbstractsReport
The abstract for each work: its own record’s if present, otherwise the first other provider’s (by priority) that has one. Works are identified by their records’ identifiers; pass a record with merged identifiers to widen the search.
Source§impl Engine
impl Engine
Sourcepub async fn resolve(&self, claim: &Claim, limit: u32) -> ResolveReport
pub async fn resolve(&self, claim: &Claim, limit: u32) -> ResolveReport
Gathers and scores every candidate for claim. limit caps results
per provider search.
Sourcepub async fn verify(&self, claim: &Claim, limit: u32) -> Verification
pub async fn verify(&self, claim: &Claim, limit: u32) -> Verification
Decides whether claim refers to a real work, stopping early once it
does.
Sourcepub fn verify_many<'a>(
&'a self,
claims: &'a [Claim],
limit: u32,
) -> impl Stream<Item = Verification> + 'a
pub fn verify_many<'a>( &'a self, claims: &'a [Claim], limit: u32, ) -> impl Stream<Item = Verification> + 'a
Verifies many claims, several at a time (each provider’s pacing still applies), yielding results in claim order as they complete.
Sourcepub async fn prefetch(&self, claims: &[Claim]) -> LookupReport
pub async fn prefetch(&self, claims: &[Claim]) -> LookupReport
Looks up every identifier the claims assert, in one batched call per provider. With a cache attached, this warms it so verifying the claims one by one (and streaming results) doesn’t look them up one by one.
Source§impl Engine
impl Engine
pub fn builder() -> EngineBuilder
Sourcepub fn providers(&self) -> impl Iterator<Item = &Arc<dyn Provider>>
pub fn providers(&self) -> impl Iterator<Item = &Arc<dyn Provider>>
Registered providers, in priority order.
Sourcepub async fn lookup(&self, ids: &[WorkId], fields: FieldSet) -> LookupReport
pub async fn lookup(&self, ids: &[WorkId], fields: FieldSet) -> LookupReport
Looks up every ID, falling through providers by priority. Never fails as a whole: per-ID outcomes are in the report.
Sourcepub async fn search(
&self,
source: Option<&str>,
query: &SearchQuery,
) -> Result<SearchReport, EngineError>
pub async fn search( &self, source: Option<&str>, query: &SearchQuery, ) -> Result<SearchReport, EngineError>
Searches one provider: source if given, otherwise the first that
supports the query’s mode.