pub fn from_content<S: decode::Source>(
        content: &mut decode::Content<S>
    ) -> Result<Self, S::Err> {
        match *content {
            decode::Content::Primitive(ref mut inner) => {
                if inner.mode() == Mode::Cer && inner.remaining() > 1000 {
                    xerr!(return Err(decode::Error::Malformed.into()))
                }
                Ok(OctetString(Inner::Primitive(inner.take_all()?)))
            }
            decode::Content::Constructed(ref mut inner) => {
                match inner.mode() {
                    Mode::Ber => Self::take_constructed_ber(inner),
                    Mode::Cer => Self::take_constructed_cer(inner),
                    Mode::Der => {
                        xerr!(Err(decode::Error::Malformed.into()))
                    }
                }
            }
        }
    }
/// Takes an octet string value from content.
Takes an octet string value from content.
Takes an octet string value from content .
pub fn from_content<S: decode::Source>(
        content: &mut decode::Content<S>
    ) -> Result<Self, S::Err> {
        match *content {
            decode::Content::Primitive(ref mut inner) => {
                if inner.mode() == Mode::Cer && inner.remaining() > 1000 {
                    xerr!(return Err(decode::Error::Malformed.into()))
                }
                Ok(OctetString(Inner::Primitive(inner.take_all()?)))
            }
            decode::Content::Constructed(ref mut inner) => {
                match inner.mode() {
                    Mode::Ber => Self::take_constructed_ber(inner),
                    Mode::Cer => Self::take_constructed_cer(inner),
                    Mode::Der => {
                        xerr!(Err(decode::Error::Malformed.into()))
                    }
                }
            }
        }
    }
pub fn from_content < S : decode :: Source > ( content : & mut decode :: Content < S > ) -> Result < Self , S :: Err > { match * content { decode :: Content :: Primitive ( ref mut inner ) => { if inner . mode ( ) == Mode :: Cer && inner . remaining ( ) > 1000 { xerr ! ( return Err ( decode Error Malformed into ( ) ) ) } Ok ( OctetString ( Inner :: Primitive ( inner . take_all ( ) ? ) ) ) } decode :: Content :: Constructed ( ref mut inner ) => { match inner . mode ( ) { Mode :: Ber => Self :: take_constructed_ber ( inner ) , Mode :: Cer => Self :: take_constructed_cer ( inner ) , Mode :: Der => { xerr ! ( Err ( decode Error Malformed into ( ) ) ) } } } } }
Takes an octet string value from content.
Takes an octet string value from content .
content
&mut decode::Content<S>
content
&mut decode::Content<S>