pub struct DefaultPersonName { /* private fields */ }
Expand description

DefaultPersonName, default implementation provided for PersonNameFormatter.

Implementations§

source§

impl DefaultPersonName

Default person name functions.

source

pub fn new( person_data: LiteMap<NameField, String>, locale: Option<Locale>, preferred_order: Option<PreferredOrder>, ) -> Result<DefaultPersonName, PersonNamesFormatterError>

Returns a new person name structure.

Trait Implementations§

source§

impl PersonName for DefaultPersonName

source§

fn name_locale(&self) -> Option<&Locale>

Returns the name locale of person name.
source§

fn preferred_order(&self) -> Option<&PreferredOrder>

Returns the preferred order of person name.
source§

fn get(&self, field: &NameField) -> &str

Returns the value of the given field name, it must match the name field requested. The string should be in NFC.
source§

fn available_name_fields(&self) -> Vec<&NameField>

Returns all available name field.
source§

fn has_name_field_kind(&self, lookup_name_field: &NameFieldKind) -> bool

Returns true if the provided field name is available.
source§

fn has_name_field(&self, lookup_name_field: &NameField) -> bool

Returns true if person have the name field matching the type and modifier.

Auto Trait Implementations§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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
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.
source§

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

source§

impl<T> MaybeSendSync for T
where T: Send + Sync,