fn build_sequence<'s, S: 's, P>(
        _tag: Tag,
        _len: Length,
        dataset: &mut DataSetReader<S, P, D>,
        dict: &D,
    ) -> Result<C<InMemDicomObject<D>>>
    where
        S: Read,
        P: Parse<dyn Read + 's>,
    {
        let mut items: C<_> = SmallVec::new();
        while let Some(token) = dataset.next() {
            match token? {
                DataToken::ItemStart { len } => {
                    // TODO if length is well defined, then it should be
                    // considered instead of finding the item delimiter.
                    items.push(Self::build_object(&mut *dataset, dict.clone(), true, len)?);
                }
                DataToken::SequenceEnd => {
                    return Ok(items);
                }
                token => return Err(DataSetSyntaxError::UnexpectedToken(token).into()),
            };
        }

        // iterator fully consumed without a sequence delimiter
        Err(DataSetSyntaxError::PrematureEnd.into())
    }
/// Build a DICOM sequence by consuming a data set parser.
Build a DICOM sequence by consuming a data set parser.
Build a DICOM sequence by consuming a data set parser .
fn build_sequence<'s, S: 's, P>(
        _tag: Tag,
        _len: Length,
        dataset: &mut DataSetReader<S, P, D>,
        dict: &D,
    ) -> Result<C<InMemDicomObject<D>>>
    where
        S: Read,
        P: Parse<dyn Read + 's>,
    {
        let mut items: C<_> = SmallVec::new();
        while let Some(token) = dataset.next() {
            match token? {
                DataToken::ItemStart { len } => {
                    // TODO if length is well defined, then it should be
                    // considered instead of finding the item delimiter.
                    items.push(Self::build_object(&mut *dataset, dict.clone(), true, len)?);
                }
                DataToken::SequenceEnd => {
                    return Ok(items);
                }
                token => return Err(DataSetSyntaxError::UnexpectedToken(token).into()),
            };
        }
        // iterator fully consumed without a sequence delimiter
        Err(DataSetSyntaxError::PrematureEnd.into())
    }
fn build_sequence < ' s , S : ' s , P > ( _tag : Tag , _len : Length , dataset : & mut DataSetReader < S , P , D > , dict : & D , ) -> Result < C < InMemDicomObject < D > > > where S : Read , P : Parse < dyn Read + ' s > , { let mut items : C < _ > = SmallVec :: new ( ) ; while let Some ( token ) = dataset . next ( ) { match token ? { DataToken :: ItemStart { len } => { // TODO if length is well defined, then it should be // considered instead of finding the item delimiter. items . push ( Self :: build_object ( & mut * dataset , dict . clone ( ) , true , len ) ? ) ; } DataToken :: SequenceEnd => { return Ok ( items ) ; } token => return Err ( DataSetSyntaxError :: UnexpectedToken ( token ) . into ( ) ) , } ; } // iterator fully consumed without a sequence delimiter Err ( DataSetSyntaxError :: PrematureEnd . into ( ) ) }
Build a DICOM sequence by consuming a data set parser.
Build a DICOM sequence by consuming a data set parser .
_tag
Tag
_len
Length
dataset
&mut DataSetReader<S, P, D>
dict
&D
_tag
Tag
_len
Length
dataset
&mut DataSetReader<S, P, D>
dict
&D