Skip to main content

Crate aspero_engine

Crate aspero_engine 

Source
Expand description

Routing, caching, merging and resilience over registered providers.

The engine owns what providers deliberately don’t: retries and backoff (retry), request pacing and the real HTTP client (transport), and choosing which provider answers what.

  • Lookup is interchangeable across providers: each ID goes to the providers that accept its kind, in priority order, until one finds it. A provider that doesn’t know an ID or fails falls through to the next; every attempt is reported.

  • Search is not interchangeable (rankings differ), so it runs against one provider: the one named, or the first capable one. Filters that provider doesn’t declare are stripped and reported as ignored, never silently dropped.

  • Resolve / verify turn a citation claim into scored candidates and a verdict (see resolve).

  • Caching: provider answers (records, “not found”, search pages) are cached with per-kind TTLs (CachePolicy) and served stale if a provider fails; every answer says how it was Served.

Not yet: fan-out search, the circuit breaker and the cross-process limiter.

Modules§

retry
Retrying one provider operation under its ResiliencePolicy.
transport
The engine’s side of the HttpClient seam: a real client, and pacing.

Structs§

Abstract
An abstract and the provider it came from.
AbstractsReport
Attempt
CachePolicy
How long cached answers are trusted (DESIGN §5). Past these, a provider is asked again; if it then fails, the old answer is served as stale.
CacheStats
Candidate
Checked
One checked claim.
CrossrefConfig
DataciteConfig
Disagreement
One field on which a record and the registry’s record of the same DOI disagree.
DoiConfig
Engine
EngineBuilder
EuropePmcConfig
LookupReport
LookupResult
OpenAlexConfig
OpenLibraryConfig
ResolveReport
SearchReport
Sighting
One provider surfacing a candidate.
SqliteCache
StandardConfig
Settings for the compiled-in providers. None disables a provider.
Verification
VersionsReport

Enums§

EngineError
Finding
Something to fix or know about one entry.
Outcome
The outcome of one provider’s attempt at one ID.
Served
Where an answer came from.
Severity
StoreError
Verdict
Via
How a candidate was found.

Traits§

Cache
What the engine needs from a cache; it depends on this, not on SQLite.

Functions§

describe_update
“RETRACTED (2010-02-06, notice doi:…, via retraction-watch)”.
disagreements
Where record contradicts registry’s record of the same DOI. Dates compare by year, any of either record’s years counting (online-first and print years differ legitimately); pages by first page.
duplicates
For each match, the earliest other match that is the same work (shares an identifier).
findings
Findings for one claim from its verification (not duplicates, which need the whole set).
standard
Builds an engine with each enabled provider behind its own paced reqwest client.

Type Aliases§

Clock
A clock, injectable so cache expiry is testable.
SecretString
Re-exported for credentials in provider configs. Secret string type.