pub fn from_integration_json(m: &Map<String, Value>) -> Option<MatchingRule> {
    match m.get("pact:matcher:type") {
      Some(value) => {
        let val = json_to_string(value);
        match val.as_str() {
          "regex" => match m.get(&val) {
            Some(s) => Some(MatchingRule::Regex(json_to_string(s))),
            None => None
          },
          "equality" => Some(MatchingRule::Equality),
          "include" => match m.get("value") {
            Some(s) => Some(MatchingRule::Include(json_to_string(s))),
            None => None
          },
          "type" => match (json_to_num(m.get("min").cloned()), json_to_num(m.get("max").cloned())) {
            (Some(min), Some(max)) => Some(MatchingRule::MinMaxType(min, max)),
            (Some(min), None) => Some(MatchingRule::MinType(min)),
            (None, Some(max)) => Some(MatchingRule::MaxType(max)),
            _ => Some(MatchingRule::Type)
          },
          "number" => Some(MatchingRule::Number),
          "integer" => Some(MatchingRule::Integer),
          "decimal" => Some(MatchingRule::Decimal),
          "real" => Some(MatchingRule::Decimal),
          "min" => match json_to_num(m.get(&val).cloned()) {
            Some(min) => Some(MatchingRule::MinType(min)),
            None => None
          },
          "max" => match json_to_num(m.get(&val).cloned()) {
            Some(max) => Some(MatchingRule::MaxType(max)),
            None => None
          },
          "timestamp" => match m.get(&val) {
            Some(s) => Some(MatchingRule::Timestamp(json_to_string(s))),
            None => None
          },
          "date" => match m.get(&val) {
            Some(s) => Some(MatchingRule::Date(json_to_string(s))),
            None => None
          },
          "time" => match m.get(&val) {
            Some(s) => Some(MatchingRule::Time(json_to_string(s))),
            None => None
          },
          "null" => Some(MatchingRule::Null),
          _ => None
        }
      },
      _ => None
    }
  }
/// Builds a `MatchingRule` from a `Value` struct used by language integrations
Builds a `MatchingRule` from a `Value` struct used by language integrations
Builds a ` MatchingRule ` from a ` Value ` struct used by language integrations
pub fn from_integration_json(m: &Map<String, Value>) -> Option<MatchingRule> {
    match m.get("pact:matcher:type") {
      Some(value) => {
        let val = json_to_string(value);
        match val.as_str() {
          "regex" => match m.get(&val) {
            Some(s) => Some(MatchingRule::Regex(json_to_string(s))),
            None => None
          },
          "equality" => Some(MatchingRule::Equality),
          "include" => match m.get("value") {
            Some(s) => Some(MatchingRule::Include(json_to_string(s))),
            None => None
          },
          "type" => match (json_to_num(m.get("min").cloned()), json_to_num(m.get("max").cloned())) {
            (Some(min), Some(max)) => Some(MatchingRule::MinMaxType(min, max)),
            (Some(min), None) => Some(MatchingRule::MinType(min)),
            (None, Some(max)) => Some(MatchingRule::MaxType(max)),
            _ => Some(MatchingRule::Type)
          },
          "number" => Some(MatchingRule::Number),
          "integer" => Some(MatchingRule::Integer),
          "decimal" => Some(MatchingRule::Decimal),
          "real" => Some(MatchingRule::Decimal),
          "min" => match json_to_num(m.get(&val).cloned()) {
            Some(min) => Some(MatchingRule::MinType(min)),
            None => None
          },
          "max" => match json_to_num(m.get(&val).cloned()) {
            Some(max) => Some(MatchingRule::MaxType(max)),
            None => None
          },
          "timestamp" => match m.get(&val) {
            Some(s) => Some(MatchingRule::Timestamp(json_to_string(s))),
            None => None
          },
          "date" => match m.get(&val) {
            Some(s) => Some(MatchingRule::Date(json_to_string(s))),
            None => None
          },
          "time" => match m.get(&val) {
            Some(s) => Some(MatchingRule::Time(json_to_string(s))),
            None => None
          },
          "null" => Some(MatchingRule::Null),
          _ => None
        }
      },
      _ => None
    }
  }
pub fn from_integration_json ( m : & Map < String , Value > ) -> Option < MatchingRule > { match m . get ( " " ) { Some ( value ) => { let val = json_to_string ( value ) ; match val . as_str ( ) { " " => match m . get ( & val ) { Some ( s ) => Some ( MatchingRule :: Regex ( json_to_string ( s ) ) ) , None => None } , " " => Some ( MatchingRule :: Equality ) , " " => match m . get ( " " ) { Some ( s ) => Some ( MatchingRule :: Include ( json_to_string ( s ) ) ) , None => None } , " " => match ( json_to_num ( m . get ( " " ) . cloned ( ) ) , json_to_num ( m . get ( " " ) . cloned ( ) ) ) { ( Some ( min ) , Some ( max ) ) => Some ( MatchingRule :: MinMaxType ( min , max ) ) , ( Some ( min ) , None ) => Some ( MatchingRule :: MinType ( min ) ) , ( None , Some ( max ) ) => Some ( MatchingRule :: MaxType ( max ) ) , _ => Some ( MatchingRule :: Type ) } , " " => Some ( MatchingRule :: Number ) , " " => Some ( MatchingRule :: Integer ) , " " => Some ( MatchingRule :: Decimal ) , " " => Some ( MatchingRule :: Decimal ) , " " => match json_to_num ( m . get ( & val ) . cloned ( ) ) { Some ( min ) => Some ( MatchingRule :: MinType ( min ) ) , None => None } , " " => match json_to_num ( m . get ( & val ) . cloned ( ) ) { Some ( max ) => Some ( MatchingRule :: MaxType ( max ) ) , None => None } , " " => match m . get ( & val ) { Some ( s ) => Some ( MatchingRule :: Timestamp ( json_to_string ( s ) ) ) , None => None } , " " => match m . get ( & val ) { Some ( s ) => Some ( MatchingRule :: Date ( json_to_string ( s ) ) ) , None => None } , " " => match m . get ( & val ) { Some ( s ) => Some ( MatchingRule :: Time ( json_to_string ( s ) ) ) , None => None } , " " => Some ( MatchingRule :: Null ) , _ => None } } , _ => None } }
Builds a `MatchingRule` from a `Value` struct used by language integrations
Builds a ` MatchingRule ` from a ` Value ` struct used by language integrations
m
&Map<String, Value>
m
&Map<String, Value>