dicom_core::ops

Trait ApplyOp

Source
pub trait ApplyOp {
    type Err: Error + 'static;

    // Required method
    fn apply(&mut self, op: AttributeOp) -> Result<(), Self::Err>;
}
Expand description

Trait for applying DICOM attribute operations.

This is typically implemented by DICOM objects and other data set types to serve as a common API for attribute manipulation.

Required Associated Types§

Source

type Err: Error + 'static

The operation error type

Required Methods§

Source

fn apply(&mut self, op: AttributeOp) -> Result<(), Self::Err>

Apply the given attribute operation on the receiving object.

Effects may slightly differ between implementations, but should always be compliant with the expectations defined in AttributeAction variants.

If the action to apply is unsupported, or not possible for other reasons, an error is returned and no changes to the receiver are made. While not all kinds of operations may be possible, generic DICOM data set holders will usually support all actions. See the respective documentation of the implementing type for more details.

Implementors§