#[non_exhaustive]pub enum AttributeAction {
Show 17 variants
Remove,
Empty,
SetVr(VR),
Set(PrimitiveValue),
SetStr(Cow<'static, str>),
SetIfMissing(PrimitiveValue),
SetStrIfMissing(Cow<'static, str>),
Replace(PrimitiveValue),
ReplaceStr(Cow<'static, str>),
PushStr(Cow<'static, str>),
PushI32(i32),
PushU32(u32),
PushI16(i16),
PushU16(u16),
PushF32(f32),
PushF64(f64),
Truncate(usize),
}
Expand description
Descriptor for the kind of action to apply over an attribute.
See the module-level documentation for more details.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Remove
Remove the attribute if it exists.
Do nothing otherwise.
Empty
If the attribute exists, clear its value to zero bytes.
SetVr(VR)
If the attribute exists, set or provide a hint about the attribute’s value representation.
The underlying value is not modified. Implementations are free to ignore this request if it cannot be done or it does not make sense for the given implementation.
Set(PrimitiveValue)
Fully reset the attribute with the given DICOM value, creating it if it does not exist yet.
For objects supporting nested data sets,
passing PrimitiveValue::Empty
will create
an empty data set sequence.
SetStr(Cow<'static, str>)
Fully reset a textual attribute with the given string, creating it if it does not exist yet.
SetIfMissing(PrimitiveValue)
Provide the attribute with the given DICOM value, if it does not exist yet.
For objects supporting nested data sets,
passing PrimitiveValue::Empty
will create
an empty data set sequence.
SetStrIfMissing(Cow<'static, str>)
Provide the textual attribute with the given string, creating it if it does not exist yet.
Replace(PrimitiveValue)
Fully replace the value with the given DICOM value, but only if the attribute already exists.
For objects supporting nested data sets,
passing PrimitiveValue::Empty
will clear the items
of an existing data set sequence.
ReplaceStr(Cow<'static, str>)
Fully replace a textual value with the given string, but only if the attribute already exists.
PushStr(Cow<'static, str>)
Append a string as an additional textual value, creating the attribute if it does not exist yet.
New value items are recorded as separate text values,
meaning that they are delimited by a backslash (\
) at encoding time,
regardless of the value representation.
PushI32(i32)
Append a 32-bit signed integer as an additional numeric value, creating the attribute if it does not exist yet.
PushU32(u32)
Append a 32-bit unsigned integer as an additional numeric value, creating the attribute if it does not exist yet.
PushI16(i16)
Append a 16-bit signed integer as an additional numeric value, creating the attribute if it does not exist yet.
PushU16(u16)
Append a 16-bit unsigned integer as an additional numeric value, creating the attribute if it does not exist yet.
PushF32(f32)
Append a 32-bit floating point number as an additional numeric value, creating the attribute if it does not exist yet.
PushF64(f64)
Append a 64-bit floating point number as an additional numeric value, creating the attribute if it does not exist yet.
Truncate(usize)
Truncate a value or a sequence to the given number of items, removing extraneous items from the end of the list.
On primitive values, this truncates the value
by the number of individual value items
(note that bytes in a PrimitiveValue::U8
are treated as individual items).
On data set sequences and pixel data fragment sequences,
this operation is applied to
the data set items (or fragments) in the sequence.
Does nothing if the attribute does not exist or the cardinality of the element is already lower than or equal to the given size.
Implementations§
Source§impl AttributeAction
impl AttributeAction
Sourcepub fn is_constructive(&self) -> bool
pub fn is_constructive(&self) -> bool
Report whether this is considered a constructive action, operations of which create new elements if they do not exist yet.
The actions currently considered to be constructive are
all actions of the families Set*
, SetIfMissing
, and Push*
.
Trait Implementations§
Source§impl Clone for AttributeAction
impl Clone for AttributeAction
Source§fn clone(&self) -> AttributeAction
fn clone(&self) -> AttributeAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AttributeAction
impl Debug for AttributeAction
Source§impl PartialEq for AttributeAction
impl PartialEq for AttributeAction
impl StructuralPartialEq for AttributeAction
Auto Trait Implementations§
impl Freeze for AttributeAction
impl RefUnwindSafe for AttributeAction
impl Send for AttributeAction
impl Sync for AttributeAction
impl Unpin for AttributeAction
impl UnwindSafe for AttributeAction
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