pub fn struct_links(&mut self) -> HashMap<String, Vec<String>> {
        let links = self.links();

        println!("links btreeset: {:#?}", links);

        let mut map: HashMap<String, Vec<String>> = HashMap::new();
        let mut vec: Vec<&str> = links.iter().map(|s| s.as_str()).collect();
        vec.sort_unstable();

        for link in vec.iter() {
            if link.contains('.') {
                let mut vec: VecDeque<&str> = link.split('.').collect();
                vec.retain(|l| !l.is_empty());
                let first = vec.pop_front().unwrap();
                let last = vec.pop_front().unwrap();
                map.entry_modify_insert(first.to_string(), last.to_string());
            } else {
                map.insert(link.to_string(), vec![]);
            }
        }

        map
    }
/// Creates a hash map of each struct and the client structs
/// it links too.
///
/// # Example
///
/// Say we have the following operation id's or operation mappings:
///     groups.calendar.calendarView
///     groups.calendarView
///     groups.drive
///
/// {
///     "groups": [
///         "calendar",
///         "calendarView",
///         "drive"
///     ],
///     "calendar": [
///         "calendarView"
///     ]
/// }
Creates a hash map of each struct and the client structs
it links too.
Creates a hash map of each struct and the client structs it links too .
pub fn struct_links(&mut self) -> HashMap<String, Vec<String>> {
        let links = self.links();
        println!("links btreeset: {:#?}", links);
        let mut map: HashMap<String, Vec<String>> = HashMap::new();
        let mut vec: Vec<&str> = links.iter().map(|s| s.as_str()).collect();
        vec.sort_unstable();
        for link in vec.iter() {
            if link.contains('.') {
                let mut vec: VecDeque<&str> = link.split('.').collect();
                vec.retain(|l| !l.is_empty());
                let first = vec.pop_front().unwrap();
                let last = vec.pop_front().unwrap();
                map.entry_modify_insert(first.to_string(), last.to_string());
            } else {
                map.insert(link.to_string(), vec![]);
            }
        }
        map
    }
pub fn struct_links ( & mut self ) -> HashMap < String , Vec < String > > { let links = self . links ( ) ; println ! ( " " links ) ; let mut map : HashMap < String , Vec < String > > = HashMap :: new ( ) ; let mut vec : Vec < & str > = links . iter ( ) . map ( | s | s . as_str ( ) ) . collect ( ) ; vec . sort_unstable ( ) ; for link in vec . iter ( ) { if link . contains ( '.' ) { let mut vec : VecDeque < & str > = link . split ( '.' ) . collect ( ) ; vec . retain ( | l | ! l . is_empty ( ) ) ; let first = vec . pop_front ( ) . unwrap ( ) ; let last = vec . pop_front ( ) . unwrap ( ) ; map . entry_modify_insert ( first . to_string ( ) , last . to_string ( ) ) ; } else { map . insert ( link . to_string ( ) , vec ! [ ] ) ; } } map }
Creates a hash map of each struct and the client structs
it links too.
Creates a hash map of each struct and the client structs it links too .
&mut self
&mut self
example
Say we have the following operation id's or operation mappings:
groups.calendar.calendarView
groups.calendarView
groups.drive

{
"groups": [
"calendar",
"calendarView",
"drive"
],
"calendar": [
"calendarView"
]
}
Say we have the following operation id ' s or operation mappings : groups . calendar . calendarView groups . calendarView groups . drive { " groups " : [ " calendar " " calendarView " " drive " ] " calendar " : [ " calendarView " ] }