pub struct ArxivSource { /* private fields */ }Expand description
arXiv Source impl. Phase 1 returns the PDF bytes and skips metadata
(the export.arxiv.org Atom feed is documented but XML parsing is
deferred to a follow-up PR — TODO Phase 1+).
Implementations§
Source§impl ArxivSource
impl ArxivSource
Sourcepub fn with_base(base: Url) -> Self
pub fn with_base(base: Url) -> Self
Construct with an arbitrary base URL.
The orchestrator (doiget-cli::commands::fetch) uses this to honor
the DOIGET_ARXIV_BASE env var, which lets integration tests point
the source at a wiremock origin without resorting to compile-time
gates. Production callers use ArxivSource::new.
Sourcepub async fn fetch_metadata_only(
&self,
id: &ArxivId,
ctx: &FetchContext,
) -> Result<Value, FetchError>
pub async fn fetch_metadata_only( &self, id: &ArxivId, ctx: &FetchContext, ) -> Result<Value, FetchError>
Fetch ONLY the Atom-feed metadata for the given arXiv id. Does NOT
touch the PDF endpoint — this is the entry point for the
metadata_only orchestrator (docs/MCP_TOOLS.md §11).
Emits a single LogEvent::Fetch row under Capability::Metadata
so the audit trail distinguishes metadata-only attempts from full
(PDF) fetches.
§Errors
FetchError::Httpon transport / status / size-cap failures.FetchError::SourceSchemaif the response body is not well-formed Atom XML.FetchError::Logif the provenance row write fails (fail-closed perdocs/PROVENANCE_LOG.md§5).
Trait Implementations§
Source§impl Clone for ArxivSource
impl Clone for ArxivSource
Source§fn clone(&self) -> ArxivSource
fn clone(&self) -> ArxivSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArxivSource
impl Debug for ArxivSource
Source§impl Default for ArxivSource
impl Default for ArxivSource
Source§impl Source for ArxivSource
impl Source for ArxivSource
Source§fn name(&self) -> &str
fn name(&self) -> &str
[doiget].source) and provenance
rows. Conventional values: "crossref", "unpaywall", "arxiv",
"openalex", "semantic-scholar", "doaj", "tdm-elsevier",
etc. (see docs/SOURCES.md).Source§fn can_serve(&self, _profile: &CapabilityProfile, ref_: &Ref) -> bool
fn can_serve(&self, _profile: &CapabilityProfile, ref_: &Ref) -> bool
can_serve to decide whether
to invoke fetch at all.