pub struct Author { /* private fields */ }Expand description
Represents a single author as (typically) described on the author line.
The attributes firstname, middlename, lastname, and authorinitials
are automatically derived from the full value of the author string. When
assigned implicitly via the author line, the value includes all of the
characters and words prior to the semicolon (;), angle bracket (<), or
the end of the line. Note that when using the implicit author line, the full
name can have a maximum of three space-separated names. If it has more, then
the full name is assigned to the firstname attribute. You can adjoin names
using an underscore (_) character.
Implementations§
Source§impl Author
impl Author
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the full name of the author.
The name includes the entire author declaration except for email.
Sourcepub fn firstname(&self) -> &str
pub fn firstname(&self) -> &str
Returns the first, forename, or given name of the author.
The first space-separated name in the value of the author attribute is
automatically assigned to firstname.
Sourcepub fn middlename(&self) -> Option<&str>
pub fn middlename(&self) -> Option<&str>
Returns the middle name or initial of the author.
If author contains three space-separated names, the second name is
assigned to the middlename attribute.
Sourcepub fn lastname(&self) -> Option<&str>
pub fn lastname(&self) -> Option<&str>
Returns the last, surname, or family name of the author.
If the author name contains two or three space-separated names, the last
of those names is assigned to the lastname attribute.
Sourcepub fn email(&self) -> Option<&str>
pub fn email(&self) -> Option<&str>
Returns the email address or URL associated with the author.
When assigned via the author line, it’s enclosed in a pair of angle
brackets (< >). A URL can be used in place of the email address.
Sourcepub fn initials(&self) -> String
pub fn initials(&self) -> String
Returns the initials of the author.
The first character of the firstname, middlename, and lastname
attribute values are assigned to the authorinitials attribute. The
value of the authorinitials attribute will consist of three characters
or less depending on how many parts are in the author’s name.