Author

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: String

Full 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: bool

Whether this author is a corresponding author

§roles: Vec<String>

Author’s roles/contributions (e.g., [“Conceptualization”, “Writing - original draft”])

Implementations§

§

impl 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

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

Check if the author is affiliated with a specific institution

§Arguments
  • institution - Institution name to check (case-insensitive)
§Returns

true if the author has an affiliation matching the institution

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

pub fn has_orcid(&self) -> bool

Check if the author has an ORCID identifier

§Returns

true if the author has an ORCID ID

pub fn is_empty(&self) -> bool

Check if the author name is empty

§Returns

true if the full name is empty or just whitespace

pub fn len(&self) -> usize

Get the length of the author’s full name

§Returns

Length of the full name string

pub fn chars(&self) -> Chars<'_>

Get an iterator over the characters in the author’s full name

§Returns

Iterator over characters

Trait Implementations§

§

impl Clone for Author

§

fn clone(&self) -> Author

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Author

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for Author

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Author, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for Author

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialEq for Author

§

fn eq(&self, other: &Author) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Serialize for Author

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,