pub struct Author {
pub surname: Option<String>,
pub given_names: Option<String>,
pub initials: Option<String>,
pub suffix: Option<String>,
pub full_name: String,
pub affiliations: Vec<Affiliation>,
pub orcid: Option<String>,
pub email: Option<String>,
pub is_corresponding: bool,
pub roles: Vec<String>,
pub collab_name: Option<String>,
}Expand description
Represents a detailed author with enhanced metadata
This structure provides a unified representation of author information across PubMed and PMC, consolidating various name formats and metadata.
Fields§
§surname: Option<String>Author’s surname (last name)
given_names: Option<String>Author’s given names (first name, middle names)
initials: Option<String>Author’s initials (useful when given_names not available)
suffix: Option<String>Name suffix (e.g., “Jr”, “Sr”, “III”)
full_name: StringFull formatted name
affiliations: Vec<Affiliation>List of institutional affiliations
orcid: Option<String>ORCID identifier (e.g., “0000-0000-0000-0000”)
email: Option<String>Author’s email address
is_corresponding: boolWhether this author is a corresponding author
roles: Vec<String>Author’s roles/contributions (e.g., [“Conceptualization”, “Writing - original draft”])
collab_name: Option<String>Collaboration / group-author name, when this contributor is a collective
rather than an individual. From JATS <collab> (PMC) or
<CollectiveName> (PubMed). When set, surname/given_names are
typically None and full_name mirrors this value.
Implementations§
Source§impl Author
impl Author
Sourcepub fn new(surname: Option<String>, given_names: Option<String>) -> Self
pub fn new(surname: Option<String>, given_names: Option<String>) -> Self
Create a new Author with basic information
Sourcepub fn from_full_name(full_name: String) -> Self
pub fn from_full_name(full_name: String) -> Self
Create an author from a full name string
This is a convenience method for when you have a complete name but don’t need to separate it into surname and given names.
Sourcepub fn collaboration(name: String) -> Self
pub fn collaboration(name: String) -> Self
Create a collaboration / group author (JATS <collab> /
PubMed <CollectiveName>), e.g. “COVID-19 Study Group”.
Sourcepub fn is_collaboration(&self) -> bool
pub fn is_collaboration(&self) -> bool
Whether this contributor is a collaboration / group author rather than an individual person.
Sourcepub fn is_affiliated_with(&self, institution: &str) -> bool
pub fn is_affiliated_with(&self, institution: &str) -> bool
Sourcepub fn primary_affiliation(&self) -> Option<&Affiliation>
pub fn primary_affiliation(&self) -> Option<&Affiliation>
Get the author’s primary affiliation (first in the list)
§Returns
A reference to the primary affiliation, if any