Struct Author
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>,
}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”])
Implementations§
§impl Author
impl Author
pub fn new(surname: Option<String>, given_names: Option<String>) -> Author
pub fn new(surname: Option<String>, given_names: Option<String>) -> Author
Create a new Author with basic information
pub fn from_full_name(full_name: String) -> Author
pub fn from_full_name(full_name: String) -> Author
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.
pub fn is_affiliated_with(&self, institution: &str) -> bool
pub fn is_affiliated_with(&self, institution: &str) -> bool
pub 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
Trait Implementations§
§impl<'de> Deserialize<'de> for Author
impl<'de> Deserialize<'de> for Author
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Author, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Author, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for Author
impl Serialize for Author
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Author
Auto Trait Implementations§
impl Freeze for Author
impl RefUnwindSafe for Author
impl Send for Author
impl Sync for Author
impl Unpin for Author
impl UnwindSafe for Author
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.