pub struct MetaAuthor {
pub name: MetaText,
pub affiliations: Vec<MetaText>,
pub email: Option<MetaText>,
pub notes: Vec<MetaText>,
pub other: BTreeMap<String, Value>,
}Expand description
One author of the document: the name, the affiliations, the email address, the notes, and every other key the author’s entry holds. Each text keeps the place it was written at, so that a problem in an affiliation is reported at the affiliation.
The name, each affiliation and each note are FLM text, which the stage
BUILD parses as inline content. The email address is a plain text: it is
not parsed, and nothing checks its form.
§Examples
use flm_core::stdlib::features::metadata::{MetaAuthor, MetaText};
let ada = MetaAuthor::new(MetaText::new("Ada Lovelace"))
.affiliation(MetaText::new(r"University of \emph{X}"))
.email(MetaText::new("ada@example.com"))
.note(MetaText::new("Corresponding author"));
assert_eq!(ada.affiliations.len(), 1);Fields§
§name: MetaTextThe author’s name.
affiliations: Vec<MetaText>The author’s affiliations, in the order written.
email: Option<MetaText>The author’s email address, a plain text.
notes: Vec<MetaText>The notes about the author, in the order written.
other: BTreeMap<String, Value>Every other key of the author’s entry, with its value as data. The library does not show these values.
Implementations§
Source§impl MetaAuthor
impl MetaAuthor
Sourcepub fn new(name: MetaText) -> MetaAuthor
pub fn new(name: MetaText) -> MetaAuthor
Returns the author named name, with nothing else.
Sourcepub fn affiliation(self, affiliation: MetaText) -> MetaAuthor
pub fn affiliation(self, affiliation: MetaText) -> MetaAuthor
Builder: adds an affiliation after those already given.
Sourcepub fn email(self, email: MetaText) -> MetaAuthor
pub fn email(self, email: MetaText) -> MetaAuthor
Builder: sets the email address.
Sourcepub fn note(self, note: MetaText) -> MetaAuthor
pub fn note(self, note: MetaText) -> MetaAuthor
Builder: adds a note after those already given.
Trait Implementations§
Source§impl Clone for MetaAuthor
impl Clone for MetaAuthor
Source§impl Debug for MetaAuthor
impl Debug for MetaAuthor
Source§impl Hash for MetaAuthor
impl Hash for MetaAuthor
Source§impl PartialEq for MetaAuthor
impl PartialEq for MetaAuthor
impl StructuralPartialEq for MetaAuthor
Auto Trait Implementations§
impl Forget for MetaAuthor
impl Freeze for MetaAuthorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<MetaText>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for MetaAuthor
impl RefUnwindSafe for MetaAuthor
impl Send for MetaAuthor
impl Sync for MetaAuthor
impl Unpin for MetaAuthor
impl UnsafeUnpin for MetaAuthorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<MetaText>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for MetaAuthor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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