pub fn load_from_map(&mut self, map: &serde_json::Map<String, Value>) {
    for (k, v) in map {
      match v {
        &Value::Object(ref map) =>  match GeneratorCategory::from_str(k) {
          Ok(ref category) => match category {
            &GeneratorCategory::PATH | &GeneratorCategory::METHOD | &GeneratorCategory::STATUS => {
              self.parse_generator_from_map(category, map, None);
            },
            _ => for (sub_k, sub_v) in map {
              match sub_v {
                &Value::Object(ref map) => self.parse_generator_from_map(category, map, Some(sub_k.clone())),
                _ => warn!("Ignoring invalid generator JSON '{}' -> {:?}", sub_k, sub_v)
              }
            }
          },
          Err(err) => warn!("Ignoring generator with invalid category '{}' - {}", k, err)
        },
        _ => warn!("Ignoring invalid generator JSON '{}' -> {:?}", k, v)
      }
    }
  }
/// Loads the generators for a JSON map
Loads the generators for a JSON map
Loads the generators for a JSON map
pub fn load_from_map(&mut self, map: &serde_json::Map<String, Value>) {
    for (k, v) in map {
      match v {
        &Value::Object(ref map) =>  match GeneratorCategory::from_str(k) {
          Ok(ref category) => match category {
            &GeneratorCategory::PATH | &GeneratorCategory::METHOD | &GeneratorCategory::STATUS => {
              self.parse_generator_from_map(category, map, None);
            },
            _ => for (sub_k, sub_v) in map {
              match sub_v {
                &Value::Object(ref map) => self.parse_generator_from_map(category, map, Some(sub_k.clone())),
                _ => warn!("Ignoring invalid generator JSON '{}' -> {:?}", sub_k, sub_v)
              }
            }
          },
          Err(err) => warn!("Ignoring generator with invalid category '{}' - {}", k, err)
        },
        _ => warn!("Ignoring invalid generator JSON '{}' -> {:?}", k, v)
      }
    }
  }
pub fn load_from_map ( & mut self , map : & serde_json :: Map < String , Value > ) { for ( k , v ) in map { match v { & Value :: Object ( ref map ) => match GeneratorCategory :: from_str ( k ) { Ok ( ref category ) => match category { & GeneratorCategory :: PATH | & GeneratorCategory :: METHOD | & GeneratorCategory :: STATUS => { self . parse_generator_from_map ( category , map , None ) ; } , _ => for ( sub_k , sub_v ) in map { match sub_v { & Value :: Object ( ref map ) => self . parse_generator_from_map ( category , map , Some ( sub_k . clone ( ) ) ) , _ => warn ! ( " " sub_k sub_v ) } } } , Err ( err ) => warn ! ( " " k err ) } , _ => warn ! ( " " k v ) } } }
Loads the generators for a JSON map
Loads the generators for a JSON map
&mut self
map
&serde_json::Map<String, Value>
&mut self
map
&serde_json::Map<String, Value>