pub fn disassemble(&self, xpath: &str, key: &str, value: &Value) -> BTreeMap<Value, Value> {
        let mut parts = BTreeMap::new();
        match value {
            Value::Map(ref tree) => {
                for (k, v) in tree.iter() {
                    let subkey = match k {
                        Value::String(data) => format!("{}", data),
                        Value::Char(data) => format!("{}", data),
                        _ => panic!("Map keys MUST be strings or char")
                    };
                    parts.append(&mut self.disassemble(&self.format_key(xpath, &key, value), &subkey, v));
                };
            }
            Value::Seq(ref values) => {
                for (i, val) in values.iter().enumerate() {
                    parts.append(&mut self.disassemble(&mut self.format_key(xpath, key, value), &format!("{}", i), val));
                }
            }
            _ => {
                parts.insert(Value::String(self.format_key(xpath, key, value)), value.clone());
            }
        };
        parts
    }
/// Dissemble the struct attribute into a flatten key/ value pair.
Dissemble the struct attribute into a flatten key/ value pair.
Dissemble the struct attribute into a flatten key / value pair .
pub fn disassemble(&self, xpath: &str, key: &str, value: &Value) -> BTreeMap<Value, Value> {
        let mut parts = BTreeMap::new();
        match value {
            Value::Map(ref tree) => {
                for (k, v) in tree.iter() {
                    let subkey = match k {
                        Value::String(data) => format!("{}", data),
                        Value::Char(data) => format!("{}", data),
                        _ => panic!("Map keys MUST be strings or char")
                    };
                    parts.append(&mut self.disassemble(&self.format_key(xpath, &key, value), &subkey, v));
                };
            }
            Value::Seq(ref values) => {
                for (i, val) in values.iter().enumerate() {
                    parts.append(&mut self.disassemble(&mut self.format_key(xpath, key, value), &format!("{}", i), val));
                }
            }
            _ => {
                parts.insert(Value::String(self.format_key(xpath, key, value)), value.clone());
            }
        };
        parts
    }
pub fn disassemble ( & self , xpath : & str , key : & str , value : & Value ) -> BTreeMap < Value , Value > { let mut parts = BTreeMap :: new ( ) ; match value { Value :: Map ( ref tree ) => { for ( k , v ) in tree . iter ( ) { let subkey = match k { Value :: String ( data ) => format ! ( " " data ) , Value :: Char ( data ) => format ! ( " " data ) , _ => panic ! ( " " ) } ; parts . append ( & mut self . disassemble ( & self . format_key ( xpath , & key , value ) , & subkey , v ) ) ; } ; } Value :: Seq ( ref values ) => { for ( i , val ) in values . iter ( ) . enumerate ( ) { parts . append ( & mut self . disassemble ( & mut self . format_key ( xpath , key , value ) , & format ! ( " " i ) , val ) ) ; } } _ => { parts . insert ( Value :: String ( self . format_key ( xpath , key , value ) ) , value . clone ( ) ) ; } } ; parts }
Dissemble the struct attribute into a flatten key/ value pair.
Dissemble the struct attribute into a flatten key / value pair .
&self
xpath
&str
key
&str
value
&Value
&self
xpath
&str
key
&str
value
&Value