pub struct Tag(pub u16, pub u16);
Expand description
The data type for DICOM data element tags.
Tags are composed by a (group, element) pair of 16-bit unsigned integers.
Aside from writing a struct expression,
a Tag
may also be built by converting a (u16, u16)
or a [u16; 2]
.
In its text form,
DICOM tags are printed by Display
in the form (GGGG,EEEE)
,
where the group and element parts are in uppercase hexadecimal.
Moreover, its FromStr
implementation
support converting strings in the following text formats into DICOM tags:
(GGGG,EEEE)
GGGG,EEEE
GGGGEEEE
§Example
let tag: Tag = "(0010,1005)".parse()?;
assert_eq!(tag, Tag(0x0010, 0x1005));
Tuple Fields§
§0: u16
§1: u16
Implementations§
Trait Implementations§
Source§impl FromStr for Tag
impl FromStr for Tag
This parser implementation for DICOM tags accepts strictly one of the following formats:
ggggeeee
- or
gggg,eeee
- or
(gggg,eeee)
where gggg
and eeee
are the characters representing
the group part an the element part in hexadecimal,
with four characters each.
Whitespace is not excluded automatically,
and may need to be removed before-parse
depending on the context.
Lowercase and uppercase characters are allowed.
Source§impl Ord for Tag
impl Ord for Tag
Source§impl PartialOrd for Tag
impl PartialOrd for Tag
impl Copy for Tag
impl Eq for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl Freeze for Tag
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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