pub struct BiorxivClient { /* private fields */ }Expand description
Client for bioRxiv.org preprint API
Provides methods to search for life sciences preprints, filter by category, and convert results to SemanticVector format for RuVector analysis.
§Categories
- neuroscience
- genomics
- bioinformatics
- cancer-biology
- immunology
- microbiology
- molecular-biology
- cell-biology
- biochemistry
- evolutionary-biology
- and many more…
§Rate Limiting
The client automatically enforces a rate limit of ~1 request per second. Includes retry logic for transient failures.
Implementations§
Source§impl BiorxivClient
impl BiorxivClient
Sourcepub fn with_embedding_dim(embedding_dim: usize) -> Self
pub fn with_embedding_dim(embedding_dim: usize) -> Self
Create a new bioRxiv API client with custom embedding dimension
§Arguments
embedding_dim- Dimension for text embeddings (default: 384)
Sourcepub async fn search_recent(
&self,
days: u64,
limit: usize,
) -> Result<Vec<SemanticVector>>
pub async fn search_recent( &self, days: u64, limit: usize, ) -> Result<Vec<SemanticVector>>
Sourcepub async fn search_by_date_range(
&self,
start_date: NaiveDate,
end_date: NaiveDate,
limit: Option<usize>,
) -> Result<Vec<SemanticVector>>
pub async fn search_by_date_range( &self, start_date: NaiveDate, end_date: NaiveDate, limit: Option<usize>, ) -> Result<Vec<SemanticVector>>
Search preprints by date range
§Arguments
start_date- Start date (inclusive)end_date- End date (inclusive)limit- Optional maximum number of results
§Example
ⓘ
use chrono::NaiveDate;
let start = NaiveDate::from_ymd_opt(2024, 1, 1).unwrap();
let end = NaiveDate::from_ymd_opt(2024, 12, 31).unwrap();
let papers = client.search_by_date_range(start, end, Some(200)).await?;Sourcepub async fn search_by_category(
&self,
category: &str,
limit: usize,
) -> Result<Vec<SemanticVector>>
pub async fn search_by_category( &self, category: &str, limit: usize, ) -> Result<Vec<SemanticVector>>
Search preprints by subject category
§Arguments
category- Subject category (e.g., “neuroscience”, “genomics”)limit- Maximum number of results to return
§Categories
- neuroscience
- genomics
- bioinformatics
- cancer-biology
- immunology
- microbiology
- molecular-biology
- cell-biology
- biochemistry
- evolutionary-biology
- ecology
- genetics
- developmental-biology
- synthetic-biology
- systems-biology
§Example
ⓘ
let neuroscience_papers = client.search_by_category("neuroscience", 100).await?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for BiorxivClient
impl !RefUnwindSafe for BiorxivClient
impl Send for BiorxivClient
impl Sync for BiorxivClient
impl Unpin for BiorxivClient
impl !UnwindSafe for BiorxivClient
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