pub fn from_content<S: decode::Source>(
        content: &mut decode::Content<S>
    ) -> Result<Self, S::Err> {
        let content = OctetString::from_content(content)?;
        if let Some(slice) = content.as_slice() {
            Self::try_from(slice).map_err(|_| decode::Malformed.into())
        }
        else if content.len() != 20 {
            Err(decode::Malformed.into())
        }
        else {
            let mut res = KeyIdentifier(Default::default());
            let mut pos = 0;
            for slice in &content {
                let end = pos + slice.len();
                res.0[pos .. end].copy_from_slice(slice);
                pos = end;
            }
            Ok(res)
        }
    }
/// Parses an encoded key identifer from a encoded content.
Parses an encoded key identifer from a encoded content.
Parses an encoded key identifer from a encoded content .
pub fn from_content<S: decode::Source>(
        content: &mut decode::Content<S>
    ) -> Result<Self, S::Err> {
        let content = OctetString::from_content(content)?;
        if let Some(slice) = content.as_slice() {
            Self::try_from(slice).map_err(|_| decode::Malformed.into())
        }
        else if content.len() != 20 {
            Err(decode::Malformed.into())
        }
        else {
            let mut res = KeyIdentifier(Default::default());
            let mut pos = 0;
            for slice in &content {
                let end = pos + slice.len();
                res.0[pos .. end].copy_from_slice(slice);
                pos = end;
            }
            Ok(res)
        }
    }
pub fn from_content < S : decode :: Source > ( content : & mut decode :: Content < S > ) -> Result < Self , S :: Err > { let content = OctetString :: from_content ( content ) ? ; if let Some ( slice ) = content . as_slice ( ) { Self :: try_from ( slice ) . map_err ( | _ | decode :: Malformed . into ( ) ) } else if content . len ( ) != 20 { Err ( decode :: Malformed . into ( ) ) } else { let mut res = KeyIdentifier ( Default :: default ( ) ) ; let mut pos = 0 ; for slice in & content { let end = pos + slice . len ( ) ; res . 0 [ pos .. end ] . copy_from_slice ( slice ) ; pos = end ; } Ok ( res ) } }
Parses an encoded key identifer from a encoded content.
Parses an encoded key identifer from a encoded content .
content
&mut decode::Content<S>