Struct icu_experimental::personnames::provider::PersonNamesFormatV1
source · pub struct PersonNamesFormatV1<'data> {
pub surname_first_locales: VarZeroVec<'data, str>,
pub given_first_locales: VarZeroVec<'data, str>,
pub foreign_space_replacement: Option<Cow<'data, str>>,
pub initial_pattern: Option<Cow<'data, str>>,
pub initial_pattern_sequence: Option<Cow<'data, str>>,
pub person_names_patterns: VarZeroVec<'data, PersonNamesFormattingDataVarULE>,
}
Expand description
This is the equivalent of https://www.unicode.org/reports/tr35/tr35-personNames.html#personnames-element
There are some liberties taken from the DTD definition, as we enforce uniqueness on some tags where the documentation doesn’t specify any of these constraints.
e.g. : initialPattern has no upper bound, DTD allows for the element to be specified any number
of times, while in this implementation we are restraining it to the 2 documented types
(initial
, initialSequence
).
Fields§
§surname_first_locales: VarZeroVec<'data, str>
given_first_locales: VarZeroVec<'data, str>
foreign_space_replacement: Option<Cow<'data, str>>
foreignSpaceReplacement element.
initial_pattern: Option<Cow<'data, str>>
Equivalent of initialPattern tag + initial
<initialPattern type="initial">{0}.</initialPattern>
initial_pattern_sequence: Option<Cow<'data, str>>
Equivalent of initialPattern tag + initialSequence
<initialPattern type="initialSequence">{0} {1}</initialPattern>
person_names_patterns: VarZeroVec<'data, PersonNamesFormattingDataVarULE>
Equivalent of PersonNames
<personName>...</personName>
Trait Implementations§
source§impl<'data> Bake for PersonNamesFormatV1<'data>
impl<'data> Bake for PersonNamesFormatV1<'data>
source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
source§impl<'data> BakeSize for PersonNamesFormatV1<'data>
impl<'data> BakeSize for PersonNamesFormatV1<'data>
source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
source§impl<'data> Clone for PersonNamesFormatV1<'data>
impl<'data> Clone for PersonNamesFormatV1<'data>
source§fn clone(&self) -> PersonNamesFormatV1<'data>
fn clone(&self) -> PersonNamesFormatV1<'data>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'de: 'data, 'data> Deserialize<'de> for PersonNamesFormatV1<'data>
impl<'de: 'data, 'data> Deserialize<'de> for PersonNamesFormatV1<'data>
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
source§impl<'data> PartialEq for PersonNamesFormatV1<'data>
impl<'data> PartialEq for PersonNamesFormatV1<'data>
source§impl<'data> Serialize for PersonNamesFormatV1<'data>
impl<'data> Serialize for PersonNamesFormatV1<'data>
source§impl<'a> Yokeable<'a> for PersonNamesFormatV1<'static>
impl<'a> Yokeable<'a> for PersonNamesFormatV1<'static>
source§type Output = PersonNamesFormatV1<'a>
type Output = PersonNamesFormatV1<'a>
This type MUST be
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
source§fn transform_owned(self) -> Self::Output
fn transform_owned(self) -> Self::Output
source§unsafe fn make(this: Self::Output) -> Self
unsafe fn make(this: Self::Output) -> Self
This method can be used to cast away
Self<'a>
’s lifetime. Read moresource§fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
This method must cast
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moresource§impl<'zf, 'zf_inner> ZeroFrom<'zf, PersonNamesFormatV1<'zf_inner>> for PersonNamesFormatV1<'zf>
impl<'zf, 'zf_inner> ZeroFrom<'zf, PersonNamesFormatV1<'zf_inner>> for PersonNamesFormatV1<'zf>
source§fn zero_from(this: &'zf PersonNamesFormatV1<'zf_inner>) -> Self
fn zero_from(this: &'zf PersonNamesFormatV1<'zf_inner>) -> Self
Clone the other
C
into a struct that may retain references into C
.impl<'data> StructuralPartialEq for PersonNamesFormatV1<'data>
Auto Trait Implementations§
impl<'data> Freeze for PersonNamesFormatV1<'data>
impl<'data> RefUnwindSafe for PersonNamesFormatV1<'data>
impl<'data> Send for PersonNamesFormatV1<'data>
impl<'data> Sync for PersonNamesFormatV1<'data>
impl<'data> Unpin for PersonNamesFormatV1<'data>
impl<'data> UnwindSafe for PersonNamesFormatV1<'data>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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> ⓘ
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 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> ⓘ
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