pub struct PersonNameBuilder<'a> { /* private fields */ }
Expand description
A builder to construct a PersonName
from its components.
§Example
let ivan: PersonName = PersonNameBuilder::new()
.with_given("Ivan")
.with_family("Levanov")
.build();
assert_eq!(&ivan.to_dicom_string(), "Levanov^Ivan");
Implementations§
Source§impl<'a> PersonNameBuilder<'a>
impl<'a> PersonNameBuilder<'a>
pub fn new() -> PersonNameBuilder<'a>
Sourcepub fn with_family(&mut self, family_name: &'a str) -> &mut Self
pub fn with_family(&mut self, family_name: &'a str) -> &mut Self
Insert or update the family name component.
Sourcepub fn with_middle(&mut self, middle_name: &'a str) -> &mut Self
pub fn with_middle(&mut self, middle_name: &'a str) -> &mut Self
Insert or update the middle name component.
Sourcepub fn with_given(&mut self, given_name: &'a str) -> &mut Self
pub fn with_given(&mut self, given_name: &'a str) -> &mut Self
Insert or update the given name component.
Sourcepub fn with_prefix(&mut self, name_prefix: &'a str) -> &mut Self
pub fn with_prefix(&mut self, name_prefix: &'a str) -> &mut Self
Insert or update the prefix component.
Sourcepub fn with_suffix(&mut self, name_suffix: &'a str) -> &mut Self
pub fn with_suffix(&mut self, name_suffix: &'a str) -> &mut Self
Insert or update the suffix component.
Sourcepub fn build(&self) -> PersonName<'a>
pub fn build(&self) -> PersonName<'a>
Builds the person name with the accumulated components.
Trait Implementations§
Source§impl<'a> Clone for PersonNameBuilder<'a>
impl<'a> Clone for PersonNameBuilder<'a>
Source§fn clone(&self) -> PersonNameBuilder<'a>
fn clone(&self) -> PersonNameBuilder<'a>
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<'a> Debug for PersonNameBuilder<'a>
impl<'a> Debug for PersonNameBuilder<'a>
Source§impl Default for PersonNameBuilder<'_>
impl Default for PersonNameBuilder<'_>
Source§impl<'a> From<&mut PersonNameBuilder<'a>> for PersonName<'a>
impl<'a> From<&mut PersonNameBuilder<'a>> for PersonName<'a>
Source§fn from(builder: &mut PersonNameBuilder<'a>) -> Self
fn from(builder: &mut PersonNameBuilder<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PersonNameBuilder<'a>> for PersonName<'a>
impl<'a> From<PersonNameBuilder<'a>> for PersonName<'a>
Source§fn from(builder: PersonNameBuilder<'a>) -> Self
fn from(builder: PersonNameBuilder<'a>) -> Self
Converts to this type from the input type.
impl<'a> Copy for PersonNameBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for PersonNameBuilder<'a>
impl<'a> RefUnwindSafe for PersonNameBuilder<'a>
impl<'a> Send for PersonNameBuilder<'a>
impl<'a> Sync for PersonNameBuilder<'a>
impl<'a> Unpin for PersonNameBuilder<'a>
impl<'a> UnwindSafe for PersonNameBuilder<'a>
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