/// Create a sequence item header using the element's raw properties.
/// An error can be raised if the given properties do not relate to a
/// sequence item, a sequence item delimiter or a sequence delimiter.
Create a sequence item header using the element's raw properties.
An error can be raised if the given properties do not relate to a
sequence item, a sequence item delimiter or a sequence delimiter.
Create a sequence item header using the element ' s raw properties . An error can be raised if the given properties do not relate to a sequence item a sequence item delimiter or a sequence delimiter .
pub fn new<T: Into<Tag>>(tag: T, len: Length) -> Result<SequenceItemHeader> {
        match tag.into() {
            Tag(0xFFFE, 0xE000) => {
                // item
                Ok(SequenceItemHeader::Item { len })
            }
            Tag(0xFFFE, 0xE00D) => {
                // item delimiter
                // delimiters should not have a positive length
                if len != Length(0) {
                    Err(Error::UnexpectedDataValueLength)
                } else {
                    Ok(SequenceItemHeader::ItemDelimiter)
                }
            }
            Tag(0xFFFE, 0xE0DD) => {
                // sequence delimiter
                Ok(SequenceItemHeader::SequenceDelimiter)
            }
            _ => Err(Error::UnexpectedElement),
        }
    }
pub fn new < T : Into < Tag > > ( tag : T , len : Length ) -> Result < SequenceItemHeader > { match tag . into ( ) { Tag ( 0xFFFE , 0xE000 ) => { // item Ok ( SequenceItemHeader :: Item { len } ) } Tag ( 0xFFFE , 0xE00D ) => { // item delimiter // delimiters should not have a positive length if len != Length ( 0 ) { Err ( Error :: UnexpectedDataValueLength ) } else { Ok ( SequenceItemHeader :: ItemDelimiter ) } } Tag ( 0xFFFE , 0xE0DD ) => { // sequence delimiter Ok ( SequenceItemHeader :: SequenceDelimiter ) } _ => Err ( Error :: UnexpectedElement ) , } }
Create a sequence item header using the element's raw properties.
Create a sequence item header using the element ' s raw properties .
tag
T
len
Length