pub struct PersonName<'a> { /* private fields */ }
Expand description
A DICOM Person Name (PN value representation).
Values of this type keep family name, given name, middle name, prefix and suffix as borrowed values. All name components are optional.
§Example
A value of type PersonName
can be obtained
either by parsing a DICOM formatted string via from_text
or by using the builder API.
let dr_seuss: PersonName = PersonName::from_text("Geisel^Theodor^Seuss^Dr.");
assert_eq!(&dr_seuss.to_string(), "Dr. Theodor Seuss Geisel");
assert_eq!(dr_seuss.prefix(), Some("Dr."));
assert_eq!(dr_seuss.given(), Some("Theodor"));
Implementations§
Source§impl<'a> PersonName<'a>
impl<'a> PersonName<'a>
Sourcepub fn to_dicom_string(&self) -> String
pub fn to_dicom_string(&self) -> String
Convert the person name into a DICOM formatted string.
Name components are interspersed with a '^'
separator.
Leading null components produce a separator,
while trailing components do not.
Sourcepub fn from_text(slice: &'a str) -> PersonName<'a>
pub fn from_text(slice: &'a str) -> PersonName<'a>
Obtains a person name by interpreting slice
as a DICOM formatted string.
The DICOM string representation is split by the '^'
separator
into its respective components.
When passing a text value to this function,
ensure that it contains a single DICOM formatted name.
Sourcepub fn builder() -> PersonNameBuilder<'a>
pub fn builder() -> PersonNameBuilder<'a>
Retrieve a builder for a person name.
See PersonNameBuilder
for more information.
Trait Implementations§
Source§impl<'a> Clone for PersonName<'a>
impl<'a> Clone for PersonName<'a>
Source§fn clone(&self) -> PersonName<'a>
fn clone(&self) -> PersonName<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for PersonName<'a>
impl<'a> Debug for PersonName<'a>
Source§impl Display for PersonName<'_>
impl Display for PersonName<'_>
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
Source§impl From<PersonName<'_>> for PrimitiveValue
impl From<PersonName<'_>> for PrimitiveValue
Source§fn from(p: PersonName<'_>) -> Self
fn from(p: PersonName<'_>) -> Self
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
Source§impl<'a> Hash for PersonName<'a>
impl<'a> Hash for PersonName<'a>
Source§impl<'a> PartialEq for PersonName<'a>
impl<'a> PartialEq for PersonName<'a>
impl<'a> Copy for PersonName<'a>
impl<'a> Eq for PersonName<'a>
impl<'a> StructuralPartialEq for PersonName<'a>
Auto Trait Implementations§
impl<'a> Freeze for PersonName<'a>
impl<'a> RefUnwindSafe for PersonName<'a>
impl<'a> Send for PersonName<'a>
impl<'a> Sync for PersonName<'a>
impl<'a> Unpin for PersonName<'a>
impl<'a> UnwindSafe for PersonName<'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
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)
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>
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>
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