dicom_encoding::transfer_syntax

Enum Codec

Source
pub enum Codec<D, R, W> {
    None,
    EncapsulatedPixelData(Option<R>, Option<W>),
    Dataset(Option<D>),
}
Expand description

A description and possible implementation regarding the encoding and decoding requirements of a transfer syntax. This is also used as a means to describe whether pixel data is encapsulated and whether this implementation supports decoding and/or encoding it.

§Type parameters

  • D should implement DataRWAdapter and defines how one should read and write DICOM data sets, such as in the case for deflated data. When no special considerations for data set reading and writing are necessary, this can be set to NeverAdapter.
  • R should implement PixelDataReader, and enables programs to convert encapsulated pixel data fragments into native pixel data.
  • W should implement PixelDataWriter, and enables programs to convert native pixel data into encapsulated pixel data.

Variants§

§

None

No codec is required for this transfer syntax.

Pixel data, if any, should be in its native, unencapsulated format.

§

EncapsulatedPixelData(Option<R>, Option<W>)

Pixel data for this transfer syntax is encapsulated and likely subjected to a specific encoding process. The first part of the tuple struct contains the pixel data decoder, whereas the second item is for the pixel data encoder.

Decoding of the pixel data is not supported if the decoder is None. In this case, the program should still be able to parse DICOM data sets and fetch the pixel data in its encapsulated form.

§

Dataset(Option<D>)

A custom data set codec is required for reading and writing data sets.

If the item in the tuple struct is None, then no reading and writing whatsoever is supported. This could be used by a stub of Deflated Explicit VR Little Endian, for example.

Trait Implementations§

Source§

impl<D: Clone, R: Clone, W: Clone> Clone for Codec<D, R, W>

Source§

fn clone(&self) -> Codec<D, R, W>

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<D: Debug, R: Debug, W: Debug> Debug for Codec<D, R, W>

Source§

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

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

impl<D: PartialEq, R: PartialEq, W: PartialEq> PartialEq for Codec<D, R, W>

Source§

fn eq(&self, other: &Codec<D, R, W>) -> bool

Tests for self and other values to be equal, and is used by ==.
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.
Source§

impl<D, R, W> StructuralPartialEq for Codec<D, R, W>

Auto Trait Implementations§

§

impl<D, R, W> Freeze for Codec<D, R, W>
where R: Freeze, W: Freeze, D: Freeze,

§

impl<D, R, W> RefUnwindSafe for Codec<D, R, W>

§

impl<D, R, W> Send for Codec<D, R, W>
where R: Send, W: Send, D: Send,

§

impl<D, R, W> Sync for Codec<D, R, W>
where R: Sync, W: Sync, D: Sync,

§

impl<D, R, W> Unpin for Codec<D, R, W>
where R: Unpin, W: Unpin, D: Unpin,

§

impl<D, R, W> UnwindSafe for Codec<D, R, W>
where R: UnwindSafe, W: UnwindSafe, D: UnwindSafe,

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.