pub struct CrossRefClient { /* private fields */ }Expand description
Client for CrossRef.org scholarly publication API
Provides methods to search for publications, filter by various criteria, and convert results to SemanticVector format for RuVector analysis.
§Rate Limiting
The client automatically enforces conservative rate limits (1 request/second). Includes polite pool support via email configuration for better rate limits. Includes retry logic for transient failures.
Implementations§
Source§impl CrossRefClient
impl CrossRefClient
Sourcepub fn with_embedding_dim(
polite_email: Option<String>,
embedding_dim: usize,
) -> Self
pub fn with_embedding_dim( polite_email: Option<String>, embedding_dim: usize, ) -> Self
Create a new CrossRef API client with custom embedding dimension
§Arguments
polite_email- Email for polite pool accessembedding_dim- Dimension for text embeddings (default: 384)
Sourcepub async fn search_works(
&self,
query: &str,
limit: usize,
) -> Result<Vec<SemanticVector>>
pub async fn search_works( &self, query: &str, limit: usize, ) -> Result<Vec<SemanticVector>>
Sourcepub async fn search_by_funder(
&self,
funder_id: &str,
limit: usize,
) -> Result<Vec<SemanticVector>>
pub async fn search_by_funder( &self, funder_id: &str, limit: usize, ) -> Result<Vec<SemanticVector>>
Sourcepub async fn search_by_subject(
&self,
subject: &str,
limit: usize,
) -> Result<Vec<SemanticVector>>
pub async fn search_by_subject( &self, subject: &str, limit: usize, ) -> Result<Vec<SemanticVector>>
Sourcepub async fn get_citations(
&self,
doi: &str,
limit: usize,
) -> Result<Vec<SemanticVector>>
pub async fn get_citations( &self, doi: &str, limit: usize, ) -> Result<Vec<SemanticVector>>
Sourcepub async fn search_recent(
&self,
query: &str,
from_date: &str,
limit: usize,
) -> Result<Vec<SemanticVector>>
pub async fn search_recent( &self, query: &str, from_date: &str, limit: usize, ) -> Result<Vec<SemanticVector>>
Sourcepub async fn search_by_type(
&self,
work_type: &str,
query: Option<&str>,
limit: usize,
) -> Result<Vec<SemanticVector>>
pub async fn search_by_type( &self, work_type: &str, query: Option<&str>, limit: usize, ) -> Result<Vec<SemanticVector>>
Search publications by type
§Arguments
work_type- Type of publication (e.g., “journal-article”, “book-chapter”, “proceedings-article”, “dataset”)query- Optional search querylimit- Maximum number of results
§Supported Types
journal-article- Journal articlesbook-chapter- Book chaptersproceedings-article- Conference proceedingsdataset- Research datasetsmonograph- Monographsreport- Technical reports
§Example
ⓘ
let datasets = client.search_by_type("dataset", Some("climate"), 10).await?;
let articles = client.search_by_type("journal-article", None, 20).await?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for CrossRefClient
impl !RefUnwindSafe for CrossRefClient
impl Send for CrossRefClient
impl Sync for CrossRefClient
impl Unpin for CrossRefClient
impl !UnwindSafe for CrossRefClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more