#[non_exhaustive]pub struct Claim {
pub text: Option<String>,
pub ids: Vec<WorkId>,
pub title: Option<String>,
pub authors: Vec<String>,
pub year: Option<i16>,
pub container: Option<String>,
pub volume: Option<String>,
pub page: Option<String>,
pub alternatives: Vec<Alternative>,
}Expand description
What a citation asserts. Any part may be missing.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: Option<String>A free-text reference, in any style.
ids: Vec<WorkId>Identifiers asserted for the work.
title: Option<String>Names as written: “Ashish Vaswani”, “Vaswani, A.”, “A. Vaswani”.
year: Option<i16>§container: Option<String>The journal (or other container), full or abbreviated.
volume: Option<String>§page: Option<String>The first page (or a range, of which the first page counts).
alternatives: Vec<Alternative>Other readings of claimed identifiers (a DOI without the hyphen at a line break), to try only if the claimed one doesn’t exist.
Implementations§
Source§impl Claim
impl Claim
Sourcepub fn from_text(text: impl Into<String>) -> Self
pub fn from_text(text: impl Into<String>) -> Self
A claim from a free-text reference, with any DOIs and arXiv IDs it mentions extracted as asserted identifiers.
Sourcepub fn from_input(input: &str) -> Self
pub fn from_input(input: &str) -> Self
A claim from whatever a user typed: if the whole input is an
identifier, a claim of just that identifier (an existence check);
otherwise a free-text reference (see Claim::from_text).
Sourcepub fn place(&self) -> Option<Place>
pub fn place(&self) -> Option<Place>
Where the claim says the work appeared, volume and first page: from its fields, else from its text (“Injury 47 (2016) 797–804”).
Sourcepub fn cited_years(&self) -> Vec<i16>
pub fn cited_years(&self) -> Vec<i16>
The years the claim cites: its year, else those in its text.