#[non_exhaustive]pub enum PdfLegStatus {
Fetched,
NoOaUrl,
Blocked {
code: ErrorCode,
message: String,
denial: Option<DenialContext>,
suggested_arxiv_id: Option<String>,
},
}Expand description
Outcome of a successful fetch_paper call.
Wire shape mirrors docs/MCP_TOOLS.md §5 FetchResult minus the
envelope chrome the MCP server wraps it in (ok: true, ref,
optional error).
path is the absolute path of the resource the orchestrator wrote to
the store. For arXiv refs and successful DOI OA-PDF fetches this is
<root>/<safekey>.pdf; for the DOI metadata-only fallback (OA URL
host off the oa-publisher allowlist, or PDF leg failed for another
transport reason — docs/REDIRECT_ALLOWLIST.md §3 informed-best-
effort posture) this is <root>/.metadata/<safekey>.toml.
Outcome of the DOI OA-PDF leg, carried on FetchPaperOutcome so a
caller can NEVER silently report a blocked PDF as a plain
“metadata-only” success (issue #118). The product promise is
“immediately explain WHY a paper can’t be fetched” — the distinction
between “there was no OA PDF to fetch” and “an OA PDF existed but we
were blocked, and here is the reason” is exactly that explanation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Fetched
A PDF was fetched and written to disk (arXiv always; DOI when the OA-publisher leg succeeded).
NoOaUrl
No OA URL was discovered (Unpaywall reported no
best_oa_location). Metadata-only is the correct, expected
result here — not a failure.
Blocked
An OA URL was discovered but the PDF could not be retrieved (host outside the oa-publisher allowlist, not-a-PDF body, transport failure, …). Metadata was still written, but the caller MUST surface this reason rather than pretending the fetch was a clean metadata-only success.
Fields
code: ErrorCodeClosed-set code, mapped from the underlying transport error
via the canonical From<FetchError> for ErrorCode.
denial: Option<DenialContext>Structured denial side-channel (ADR-0023) when the failure
was an allowlist / scheme denial; None otherwise.
Trait Implementations§
Source§impl Clone for PdfLegStatus
impl Clone for PdfLegStatus
Source§fn clone(&self) -> PdfLegStatus
fn clone(&self) -> PdfLegStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more