dicom_core::value

Struct DataSetSequence

Source
pub struct DataSetSequence<I> { /* private fields */ }
Expand description

A sequence of complex data set items of type I.

Implementations§

Source§

impl<I> DataSetSequence<I>

Source

pub fn new(items: impl Into<C<I>>, length: Length) -> Self

Construct a DICOM data sequence using a sequence of items and a length.

Note: This function does not validate the length against the items. When not sure, length can be set to UNDEFINED to leave it as implicitly defined.

Source

pub fn empty() -> Self

Construct an empty DICOM data sequence, with the length explicitly defined to zero.

Source

pub fn items(&self) -> &[I]

Gets a reference to the items of a sequence.

Source

pub fn items_mut(&mut self) -> &mut C<I>

Gets a mutable reference to the items of a sequence.

Source

pub fn multiplicity(&self) -> u32

Obtain the number of items in the sequence.

Source

pub fn into_items(self) -> C<I>

Retrieve the sequence of items, discarding the recorded length information.

Source

pub fn length(&self) -> Length

Get the value data’s length as specified by the sequence’s data element, in bytes.

This is equivalent to HasLength::length.

Source

pub fn truncate(&mut self, limit: usize)

Shorten this sequence by removing trailing data set items to fit the given limit.

Trait Implementations§

Source§

impl<I: Clone> Clone for DataSetSequence<I>

Source§

fn clone(&self) -> DataSetSequence<I>

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<I: Debug> Debug for DataSetSequence<I>

Source§

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

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

impl<I> DicomValueType for DataSetSequence<I>

Source§

fn value_type(&self) -> ValueType

Retrieve the specific type of this value.
Source§

fn cardinality(&self) -> usize

Retrieve the number of elements contained in the DICOM value. Read more
Source§

impl<I> From<[I; 1]> for DataSetSequence<I>

Source§

fn from([item]: [I; 1]) -> Self

Constructs a data set sequence with a single item and an undefined length.

Source§

impl<I, P> From<DataSetSequence<I>> for Value<I, P>

Source§

fn from(value: DataSetSequence<I>) -> Self

Converts to this type from the input type.
Source§

impl<A, I> From<SmallVec<A>> for DataSetSequence<I>
where A: Array<Item = I>, C<I>: From<SmallVec<A>>,

Source§

fn from(items: SmallVec<A>) -> Self

Converts a smallvec of items into a data set sequence with an undefined length.

Source§

impl<I> From<Vec<I>> for DataSetSequence<I>

Source§

fn from(items: Vec<I>) -> Self

Converts a vector of items into a data set sequence with an undefined length.

Source§

impl<I> HasLength for DataSetSequence<I>

Source§

fn length(&self) -> Length

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

fn is_empty(&self) -> bool

Check whether the value is empty (0 length).
Source§

impl<I> PartialEq for DataSetSequence<I>
where I: PartialEq,

Source§

fn eq(&self, other: &DataSetSequence<I>) -> bool

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

This implementation only checks for item equality, disregarding the byte length.

1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<I> Freeze for DataSetSequence<I>
where I: Freeze,

§

impl<I> RefUnwindSafe for DataSetSequence<I>
where I: RefUnwindSafe,

§

impl<I> Send for DataSetSequence<I>
where I: Send,

§

impl<I> Sync for DataSetSequence<I>
where I: Sync,

§

impl<I> Unpin for DataSetSequence<I>
where I: Unpin,

§

impl<I> UnwindSafe for DataSetSequence<I>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 T
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.