pub struct UnpaywallSource { /* private fields */ }Expand description
Unpaywall Source impl.
Implementations§
Source§impl UnpaywallSource
impl UnpaywallSource
Sourcepub fn new(contact_email: String) -> Self
pub fn new(contact_email: String) -> Self
Production constructor. The contact_email is REQUIRED for the polite
pool — Unpaywall returns 403 without it.
Sourcepub fn with_base(base: Url, contact_email: String) -> Self
pub fn with_base(base: Url, contact_email: String) -> Self
Construct with an arbitrary base URL.
The orchestrator (doiget-cli::commands::fetch) uses this to honor
the DOIGET_UNPAYWALL_BASE env var, which lets integration tests
point the source at a wiremock origin without compile-time gates.
Production callers use UnpaywallSource::new.
Trait Implementations§
Source§impl Clone for UnpaywallSource
impl Clone for UnpaywallSource
Source§fn clone(&self) -> UnpaywallSource
fn clone(&self) -> UnpaywallSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnpaywallSource
impl Debug for UnpaywallSource
Source§impl Source for UnpaywallSource
impl Source for UnpaywallSource
Source§fn name(&self) -> &str
fn name(&self) -> &str
Stable name used in metadata (
[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
True if this source can plausibly serve the given ref under the
runtime capability profile. Implementations MUST be fast and
non-blocking; the orchestrator calls
can_serve to decide whether
to invoke fetch at all.Source§fn fetch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ref_: &'life1 Ref,
_profile: &'life2 CapabilityProfile,
ctx: &'life3 FetchContext,
) -> Pin<Box<dyn Future<Output = Result<FetchResult, FetchError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn fetch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ref_: &'life1 Ref,
_profile: &'life2 CapabilityProfile,
ctx: &'life3 FetchContext,
) -> Pin<Box<dyn Future<Output = Result<FetchResult, FetchError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Perform the source-specific fetch. Read more
Auto Trait Implementations§
impl Freeze for UnpaywallSource
impl RefUnwindSafe for UnpaywallSource
impl Send for UnpaywallSource
impl Sync for UnpaywallSource
impl Unpin for UnpaywallSource
impl UnsafeUnpin for UnpaywallSource
impl UnwindSafe for UnpaywallSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more