pub struct Paper {Show 15 fields
pub paper_id: String,
pub title: String,
pub authors: String,
pub abstract: String,
pub doi: Option<String>,
pub published_date: Option<String>,
pub updated_date: Option<String>,
pub pdf_url: Option<String>,
pub url: String,
pub source: SourceType,
pub categories: Option<String>,
pub keywords: Option<String>,
pub citations: Option<u32>,
pub references: Option<String>,
pub extra: Option<HashMap<String, Value>>,
}Expand description
A research paper from any academic source
This struct provides a standardized format for papers across all sources, making it easy to work with papers from multiple repositories.
Fields§
§paper_id: StringUnique identifier (source-specific: DOI, PMID, arXiv ID, etc.)
title: StringPaper title
Authors (semicolon-separated)
abstract: StringAbstract text
doi: Option<String>Digital Object Identifier
published_date: Option<String>Publication date (ISO format)
updated_date: Option<String>Last updated date (ISO format)
pdf_url: Option<String>Direct PDF URL
url: StringPaper page URL
source: SourceTypeSource where the paper was found
categories: Option<String>Categories/tags (semicolon-separated)
keywords: Option<String>Keywords (semicolon-separated)
citations: Option<u32>Citation count
references: Option<String>Reference IDs (semicolon-separated)
extra: Option<HashMap<String, Value>>Source-specific metadata (flexible JSON)
Implementations§
Source§impl Paper
impl Paper
Sourcepub fn new(
paper_id: String,
title: String,
url: String,
source: SourceType,
) -> Self
pub fn new( paper_id: String, title: String, url: String, source: SourceType, ) -> Self
Create a new paper with required fields
Sourcepub fn primary_id(&self) -> &str
pub fn primary_id(&self) -> &str
Returns the primary identifier for this paper (DOI if available, else paper_id)
Returns the author names as a vector
Sourcepub fn category_list(&self) -> Vec<&str>
pub fn category_list(&self) -> Vec<&str>
Returns the categories as a vector
Sourcepub fn keyword_list(&self) -> Vec<&str>
pub fn keyword_list(&self) -> Vec<&str>
Returns the keywords as a vector
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Paper
impl<'de> Deserialize<'de> for Paper
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Paper
impl RefUnwindSafe for Paper
impl Send for Paper
impl Sync for Paper
impl Unpin for Paper
impl UnsafeUnpin for Paper
impl UnwindSafe for Paper
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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