Enum dicom_core::ops::AttributeAction
source · #[non_exhaustive]pub enum AttributeAction {
Show 16 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),
}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.
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<AttributeAction> for AttributeAction
impl PartialEq<AttributeAction> for AttributeAction
source§fn eq(&self, other: &AttributeAction) -> bool
fn eq(&self, other: &AttributeAction) -> bool
self and other values to be equal, and is used
by ==.