[][src]Enum dicom_core::value::Value

pub enum Value<I> {
    Primitive(PrimitiveValue),
    Sequence {
        items: C<I>,
        size: Length,
    },
}

Representation of a full DICOM value, which may be either primitive or another DICOM object.

Variants

Primitive(PrimitiveValue)

Primitive value

Sequence

A complex sequence of items

Fields of Sequence

items: C<I>

Item collection.

size: Length

The size in bytes.

Methods

impl<I> Value<I> where
    I: DicomValueType
[src]

pub fn multiplicity(&self) -> u32[src]

Obtain the number of individual values. In a sequence item, this is the number of items.

pub fn primitive(&self) -> Option<&PrimitiveValue>[src]

Gets a reference to the primitive value.

pub fn item(&self) -> Option<&[I]>[src]

Gets a reference to the items.

pub fn into_primitive(self) -> Option<PrimitiveValue>[src]

Retrieves the primitive value.

pub fn into_item(self) -> Option<C<I>>[src]

Retrieves the items.

pub fn to_str(&self) -> Result<Cow<str>, CastValueError>[src]

Retrieves the primitive value as a single string.

If the value contains multiple strings, they are concatenated (separated by '\\') into an owned string.

pub fn as_u8(&self) -> Result<&[u8], CastValueError>[src]

Retrieves the primitive value as a sequence of unsigned bytes.

pub fn as_i32(&self) -> Result<&[i32], CastValueError>[src]

Retrieves the primitive value as a sequence of signed 32-bit integers.

pub fn to_tag(&self) -> Result<Tag, CastValueError>[src]

Retrieves the primitive value as a DICOM tag.

pub fn as_tags(&self) -> Result<&[Tag], CastValueError>[src]

Retrieves the primitive value as a sequence of DICOM tags.

Trait Implementations

impl<I> DicomValueType for Value<I> where
    I: DicomValueType
[src]

fn is_empty(&self) -> bool[src]

Check whether the value is empty (0 length).

impl<I> From<PrimitiveValue> for Value<I>[src]

impl<I: PartialEq> PartialEq<Value<I>> for Value<I>[src]

impl<I: Clone> Clone for Value<I>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<I: Debug> Debug for Value<I>[src]

Auto Trait Implementations

impl<I> Send for Value<I> where
    I: Send

impl<I> Unpin for Value<I> where
    I: Unpin

impl<I> Sync for Value<I> where
    I: Sync

impl<I> UnwindSafe for Value<I> where
    I: RefUnwindSafe + UnwindSafe

impl<I> RefUnwindSafe for Value<I> where
    I: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]