#[non_exhaustive]pub struct MetadataOnlyOutcome {
pub source: String,
pub resolver_profile: String,
pub license: Option<String>,
pub oa_url: Option<String>,
pub oa_status: Option<String>,
pub metadata: Value,
pub metadata_quality: Vec<String>,
pub repaired_fields: BTreeMap<String, String>,
}Expand description
Outcome of a successful metadata_only call.
Mirrors the wire shape documented in docs/MCP_TOOLS.md §11: the
source identifies which resolver produced the metadata, license
is the OA license string when known (Unpaywall channel), oa_url is
the discovered OA URL (never followed by this orchestrator), and
metadata is the source’s native JSON payload (Crossref message,
Unpaywall work record, or the parsed arXiv Atom-feed object).
metadata is serialized as-is by the MCP envelope builder
(crates/doiget-mcp/src/lib.rs); we deliberately do NOT normalize
here so the agent can see exactly what the source returned.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.source: StringResolver key that produced the metadata payload. One of
"crossref", "unpaywall", "arxiv" (the closed set named in
docs/MCP_TOOLS.md §11 type alias).
resolver_profile: StringResolver profile under which the canonical-digest (ADR-0021 §1)
was minted for this call. In Slice 4 this equals
Self::source verbatim (the metadata-only path emits one row
per consulted resolver); future slices that introduce overlapping
resolvers MAY have resolver_profile != source. Surfaced through
the doiget_metadata_only MCP envelope per ADR-0021 §4.
license: Option<String>OA license string when the resolver could supply one (today only
the Unpaywall fallback path populates this). None when the
primary source did not surface a license.
oa_url: Option<String>Discovered OA URL — surfaced to the caller for separate action,
never followed by this orchestrator. The Crossref response’s
message.link[] array is mined first; the Unpaywall fallback
path uses best_oa_location.url_for_pdf (or url).
oa_status: Option<String>Open-access status for the ref, when known (#281 item 4): the
Unpaywall classification gold / green / hybrid / bronze /
closed, or "green" for an arXiv ref. None when the resolver
that answered did not surface it — notably the Crossref-first
metadata path, which does NOT consult Unpaywall unless Crossref
fails, so a None here means “not determined”, not “no OA”.
#[serde(default)] keeps older resolver_cache entries (written
before this field existed) readable.
metadata: ValueSource’s native metadata payload. For Crossref this is the
message object; for Unpaywall the work record; for arXiv the
parsed Atom-feed JSON (see
crate::sources::arxiv::parse_atom_feed).
metadata_quality: Vec<String>Quality flags on what metadata_only_to_store wrote, e.g.
replacement_char:venue for a field that still carries a U+FFFD
(#608). metadata above stays the resolver’s payload as received, so
this – with repaired_fields – is how a caller learns the stored
entry differs from it. Empty from the pure resolvers, which store
nothing.
repaired_fields: BTreeMap<String, String>Fields metadata_only_to_store repaired from another enabled
source before writing, field -> source key (#608).
Trait Implementations§
Source§impl Clone for MetadataOnlyOutcome
impl Clone for MetadataOnlyOutcome
Source§fn clone(&self) -> MetadataOnlyOutcome
fn clone(&self) -> MetadataOnlyOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more