#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

source

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

source§

fn clone(&self) -> AttributeAction

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AttributeAction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<AttributeAction> for AttributeAction

source§

fn eq(&self, other: &AttributeAction) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for AttributeAction

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.