fn try_from(resp: &RawResponse) -> Result<Self> {
        err_if_not_kind(resp, Kind::Capabilities)?;

        let db_iter = resp
            .data_blocks
            .as_ref()
            .ok_or_else(|| Error::de("Missing data blocks."))
            .map(DataBlocks::unterminated)?;

        let capabilities: HashMap<String, Capability> = db_iter
            .map(String::from_utf8_lossy)
            .map(|entry| {
                let mut entry_iter = entry.split_whitespace().peekable();
                let label = entry_iter
                    .next()
                    .map(ToString::to_string)
                    .ok_or_else(|| Error::de("Entry does not have a label"))?;

                let args = if entry_iter.peek().is_some() {
                    Some(entry_iter.map(ToString::to_string).collect::<HashSet<_>>())
                } else {
                    None
                };

                let cap = Capability {
                    name: label.clone(),
                    args,
                };

                Ok((label, cap))
            })
            .collect::<Result<_>>()?;

        Ok(Self(capabilities))
    }
/// Parse capabilities from a response
///
/// The specific format is taken from [RFC 3977](https://tools.ietf.org/html/rfc3977#section-9.5)
Parse capabilities from a response
The specific format is taken from [RFC 3977]
Parse capabilities from a response The specific format is taken from [ RFC 3977 ]
fn try_from(resp: &RawResponse) -> Result<Self> {
        err_if_not_kind(resp, Kind::Capabilities)?;
        let db_iter = resp
            .data_blocks
            .as_ref()
            .ok_or_else(|| Error::de("Missing data blocks."))
            .map(DataBlocks::unterminated)?;
        let capabilities: HashMap<String, Capability> = db_iter
            .map(String::from_utf8_lossy)
            .map(|entry| {
                let mut entry_iter = entry.split_whitespace().peekable();
                let label = entry_iter
                    .next()
                    .map(ToString::to_string)
                    .ok_or_else(|| Error::de("Entry does not have a label"))?;
                let args = if entry_iter.peek().is_some() {
                    Some(entry_iter.map(ToString::to_string).collect::<HashSet<_>>())
                } else {
                    None
                };
                let cap = Capability {
                    name: label.clone(),
                    args,
                };
                Ok((label, cap))
            })
            .collect::<Result<_>>()?;
        Ok(Self(capabilities))
    }
fn try_from ( resp : & RawResponse ) -> Result < Self > { err_if_not_kind ( resp , Kind :: Capabilities ) ? ; let db_iter = resp . data_blocks . as_ref ( ) . ok_or_else ( | | Error :: de ( " " ) ) . map ( DataBlocks :: unterminated ) ? ; let capabilities : HashMap < String , Capability > = db_iter . map ( String :: from_utf8_lossy ) . map ( | entry | { let mut entry_iter = entry . split_whitespace ( ) . peekable ( ) ; let label = entry_iter . next ( ) . map ( ToString :: to_string ) . ok_or_else ( | | Error :: de ( " " ) ) ? ; let args = if entry_iter . peek ( ) . is_some ( ) { Some ( entry_iter . map ( ToString :: to_string ) . collect :: < HashSet < _ > > ( ) ) } else { None } ; let cap = Capability { name : label . clone ( ) , args , } ; Ok ( ( label , cap ) ) } ) . collect :: < Result < _ > > ( ) ? ; Ok ( Self ( capabilities ) ) }
Parse capabilities from a response
The specific format is taken from [RFC 3977](https://tools.ietf.org/html/rfc3977#section-9.5)
Parse capabilities from a response The specific format is taken from [ RFC 3977 ] ( https : // tools . ietf . org / html / rfc3977#section - 9 . 5 )
resp
&RawResponse