#[non_exhaustive]pub struct Author<'a> {
pub first_name: &'a str,
pub middle_name: Option<&'a str>,
pub last_name: &'a str,
pub initials: &'a str,
pub email: Option<&'a str>,
}Expand description
An Author represents the author of a document.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.first_name: &'a str§middle_name: Option<&'a str>§last_name: &'a str§initials: &'a str§email: Option<&'a str>Implementations§
Source§impl<'a> Author<'a>
impl<'a> Author<'a>
Sourcepub fn from_parts(
first_name: &'a str,
middle_name: Option<&'a str>,
last_name: &'a str,
initials: &'a str,
) -> Self
pub fn from_parts( first_name: &'a str, middle_name: Option<&'a str>, last_name: &'a str, initials: &'a str, ) -> Self
Assemble an author from already-prepared name parts. No normalization or allocation happens — callers (tests, external consumers) are responsible for providing the display-ready strings they want.
Sourcepub fn with_email(self, email: &'a str) -> Self
pub fn with_email(self, email: &'a str) -> Self
Set the email address.
Trait Implementations§
impl<'a> StructuralPartialEq for Author<'a>
Auto Trait Implementations§
impl<'a> Freeze for Author<'a>
impl<'a> RefUnwindSafe for Author<'a>
impl<'a> Send for Author<'a>
impl<'a> Sync for Author<'a>
impl<'a> Unpin for Author<'a>
impl<'a> UnsafeUnpin for Author<'a>
impl<'a> UnwindSafe for Author<'a>
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
Mutably borrows from an owned value. Read more