Struct gedcomx::NameForm [−][src]
#[non_exhaustive]pub struct NameForm { pub lang: Option<Lang>, pub full_text: Option<String>, pub parts: Vec<NamePart>, }
Expand description
A representation of a name (a “name form”) within a given cultural context, such as a given language and script.
As names are captured (both in records or in applications), the terms in the name are sometimes classified by type. For example, a certificate of death might prompt for “given name(s)” and “surname”. The parts list can be used to represent the terms in the name that have been classified.
If both a full rendering of the name and a list of parts are provided, it NOT REQUIRED that every term in the fully rendered name appear in the list of parts.
Name parts in the parts list SHOULD be ordered in the natural order they would be used in the applicable cultural context.
If a full rendering of the name is not provided (i.e., the name has only been expressed in parts), a full rendering of the name MAY be derived (sans punctuation) by concatenating, in order, each name part value in the list of parts, separating each part with the name part separator appropriate for the applicable cultural context.
Examples
Consider the following: the Russian name “Пётр Ильи́ч Чайко́вский” in the Cyrillic script, its Latin-script equivalent “Pyotr Ilyich Tchaikovsky”, and its anglicised equivalent “Peter Ilyich Tchaikovsky”. Using an informal pseudo code, these name forms might be modeled as follows:
NameForm1.locale=ru-Cyrl
NameForm1.fullText=Пётр Ильи́ч Чайко́вский
NameForm1.parts[0].type=http://gedcomx.org/Given
NameForm1.parts[0].value=Пётр
NameForm1.parts[0].qualifiers[0]=http://gedcomx.org/First
NameForm1.parts[1].type=http://gedcomx.org/Middle
NameForm1.parts[1].value=Ильи́ч
NameForm1.parts[1].qualifiers[0]=http://gedcomx.org/Middle
NameForm1.parts[2].type=http://gedcomx.org/Surname
NameForm1.parts[2].value=Чайко́вский
NameForm2.locale=ru-Latn
NameForm2.fullText=Pyotr Ilyich Tchaikovsky
NameForm2.parts[0].type=http://gedcomx.org/Given
NameForm2.parts[0].value=Pyotr
NameForm2.parts[0].qualifiers[0]=http://gedcomx.org/First
NameForm2.parts[1].type=http://gedcomx.org/Given
NameForm2.parts[1].value=Ilyich
NameForm2.parts[1].qualifiers[0]=http://gedcomx.org/Middle
NameForm2.parts[2].type=http://gedcomx.org/Surname
NameForm2.parts[2].value=Tchaikovsky
NameForm3.locale=en-Latn
NameForm3.fullText=Peter Ilyich Tchaikovsky
NameForm3.parts[0].type=http://gedcomx.org/Given
NameForm3.parts[0].value=Peter
NameForm3.parts[0].qualifiers[0]=http://gedcomx.org/First
NameForm3.parts[1].type=http://gedcomx.org/Given
NameForm3.parts[1].value=Ilyich
NameForm3.parts[1].qualifiers[0]=http://gedcomx.org/Middle
NameForm3.parts[2].type=http://gedcomx.org/Surname
NameForm3.parts[2].value=Tchaikovsky
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.lang: Option<Lang>
The locale identifier for the name form.
full_text: Option<String>
A full rendering of the name (or as much of the name as is known).
parts: Vec<NamePart>
Any identified name parts from the name.
Implementations
Trait Implementations
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
fn serialize_attributes(
&self,
source_attributes: Vec<OwnedAttribute>,
source_namespace: Namespace
) -> Result<(Vec<OwnedAttribute>, Namespace), String>
Auto Trait Implementations
impl RefUnwindSafe for NameForm
impl UnwindSafe for NameForm
Blanket Implementations
Mutably borrows from an owned value. Read more