#[non_exhaustive]pub struct Person {
pub given: Option<String>,
pub family: Option<String>,
pub literal: Option<String>,
pub orcid: Option<String>,
}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.given: Option<String>§family: Option<String>§literal: Option<String>A name that was not split into given/family, or an organisation.
orcid: Option<String>Bare ORCID iD, e.g. 0000-0002-1825-0097.
Implementations§
Source§impl Person
impl Person
pub fn new(given: impl Into<String>, family: impl Into<String>) -> Self
pub fn literal(name: impl Into<String>) -> Self
Sourcepub fn parts(&self) -> Option<(String, Option<String>)>
pub fn parts(&self) -> Option<(String, Option<String>)>
Family and given names: as given, or split from a name written
whole (“Vincent van Gogh” → “van Gogh”, “Vincent”). None for an
organisation, or a name that may be one (“WHO”, “GBD 2019
Collaborators”).
Sourcepub fn initials(&self) -> Option<String>
pub fn initials(&self) -> Option<String>
The given names’ initials: “Dong Vu” → “DV”, “Jean-Pierre” → “JP”, “T. D. N.” → “TDN”.
Sourcepub fn short(&self) -> Option<String>
pub fn short(&self) -> Option<String>
The name as Vancouver writes it: “Laan DV”; an organisation as written.
Sourcepub fn display_name(&self) -> Option<String>
pub fn display_name(&self) -> Option<String>
The best single-string name: “Given Family”, or the literal.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Person
impl<'de> Deserialize<'de> for Person
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Person
impl StructuralPartialEq for Person
Auto Trait Implementations§
impl Forget for Person
impl Freeze for Person
impl Move for Person
impl RefUnwindSafe for Person
impl Send for Person
impl Sync for Person
impl Unpin for Person
impl UnsafeUnpin for Person
impl UnwindSafe for Person
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