[][src]Trait dicom_encoding::decode::DecodeFrom

pub trait DecodeFrom<S: ?Sized + Read> {
    fn decode_header(
        &self,
        source: &mut S
    ) -> Result<(DataElementHeader, usize)>;
fn decode_item_header(&self, source: &mut S) -> Result<SequenceItemHeader>;
fn decode_tag(&self, source: &mut S) -> Result<Tag>; }

Type trait for reading and decoding DICOM data elements from a specific source

  • reader type.
  • The specific behaviour of decoding, even when abstracted from the original source,
  • may depend on the transfer syntax.

Required methods

fn decode_header(&self, source: &mut S) -> Result<(DataElementHeader, usize)>

Fetch and decode the next data element header from the given source.

  • This method returns only the header of the element. At the end of this operation, the source
  • will be pointing at the element's value data, which should be read or skipped as necessary.
  • Decoding an item or sequence delimiter is considered valid, and so should be properly handled
  • by the decoder. The value representation in this case should be UN.
  • Returns the expected header and the exact number of bytes read from the source.

fn decode_item_header(&self, source: &mut S) -> Result<SequenceItemHeader>

Fetch and decode the next sequence item head from the given source. It is a separate method

  • because value representation is always implicit when reading item headers and delimiters.
  • This method returns only the header of the item. At the end of this operation, the source
  • will be pointing at the beginning of the item's data, which should be traversed if necessary.

fn decode_tag(&self, source: &mut S) -> Result<Tag>

Decode a DICOM attribute tag from the given source.

Loading content...

Implementations on Foreign Types

impl<'_, S: ?Sized, T: ?Sized> DecodeFrom<S> for &'_ T where
    S: Read,
    T: DecodeFrom<S>, 
[src]

impl<S: ?Sized, T: ?Sized> DecodeFrom<S> for Box<T> where
    S: Read,
    T: DecodeFrom<S>, 
[src]

Loading content...

Implementors

impl<S: ?Sized> DecodeFrom<S> for ExplicitVRBigEndianDecoder where
    S: Read
[src]

impl<S: ?Sized> DecodeFrom<S> for ExplicitVRLittleEndianDecoder where
    S: Read
[src]

impl<S: ?Sized, D> DecodeFrom<S> for ImplicitVRLittleEndianDecoder<D> where
    S: Read,
    D: DataDictionary
[src]

Loading content...