pub struct CrossrefBuilder { /* private fields */ }Expand description
Implementations§
Source§impl CrossrefBuilder
impl CrossrefBuilder
Sourcepub fn new() -> CrossrefBuilder
pub fn new() -> CrossrefBuilder
Constructs a new CrossrefBuilder.
This is the same as Crossref::builder().
Sourcepub fn polite(self, email: &str) -> Self
pub fn polite(self, email: &str) -> Self
be polite and set your email as User-Agent
will get you in the polite pool of crossref
Sourcepub fn user_agent(self, user_agent: &str) -> Self
pub fn user_agent(self, user_agent: &str) -> Self
set the user agent directly
Sourcepub fn base_url(self, url: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
Overrides the API base URL. Lets tests redirect every request
to a wiremock server: .base_url(mock.uri()).
Sourcepub fn http_client(self, client: Client) -> Self
pub fn http_client(self, client: Client) -> Self
Replaces the internal reqwest::Client. Useful for sharing a
connection pool, embedding middleware (retry layers, tracing,
custom user-agent), or in tests that want fast-fail timeouts.
When set, the polite, user_agent, and token headers are
not applied — the caller is responsible for any headers they
want on the provided client.
Trait Implementations§
Source§impl Default for CrossrefBuilder
impl Default for CrossrefBuilder
Source§fn default() -> CrossrefBuilder
fn default() -> CrossrefBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for CrossrefBuilder
impl !UnwindSafe for CrossrefBuilder
impl Freeze for CrossrefBuilder
impl Send for CrossrefBuilder
impl Sync for CrossrefBuilder
impl Unpin for CrossrefBuilder
impl UnsafeUnpin for CrossrefBuilder
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