1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::frame::frame_errors::CqlSupportedParseError;
use crate::frame::types;
use std::collections::HashMap;

#[derive(Debug)]
pub struct Supported {
    pub options: HashMap<String, Vec<String>>,
}

impl Supported {
    pub fn deserialize(buf: &mut &[u8]) -> Result<Self, CqlSupportedParseError> {
        let options = types::read_string_multimap(buf)
            .map_err(CqlSupportedParseError::OptionsMapDeserialization)?;

        Ok(Supported { options })
    }
}