dicom_core::header

Trait HasLength

Source
pub trait HasLength {
    // Required method
    fn length(&self) -> Length;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Trait for any DICOM entity (element or item) which may have a length.

Required Methods§

Source

fn length(&self) -> Length

Retrieve the value data’s length as specified by the data element or item, in bytes.

It is named length to make it distinct from the conventional method signature len(&self) -> usize for the number of elements of a collection.

According to the standard, the concrete value size may be undefined, which can be the case for sequence elements or specific primitive values.

Provided Methods§

Source

fn is_empty(&self) -> bool

Check whether the value is empty (0 length).

Implementors§