pub fn to_json(&self) -> Value {
    match self {
      &Generator::RandomInt(min, max) => json!({ "type": "RandomInt", "min": min, "max": max }),
      &Generator::Uuid => json!({ "type": "Uuid" }),
      &Generator::RandomDecimal(digits) => json!({ "type": "RandomDecimal", "digits": digits }),
      &Generator::RandomHexadecimal(digits) => json!({ "type": "RandomHexadecimal", "digits": digits }),
      &Generator::RandomString(size) => json!({ "type": "RandomString", "size": size }),
      &Generator::Regex(ref regex) => json!({ "type": "Regex", "regex": regex }),
      &Generator::Date(ref format) => match format {
        &Some(ref format) => json!({ "type": "Date", "format": format }),
        &None => json!({ "type": "Date" })
      },
      &Generator::Time(ref format) => match format {
        &Some(ref format) => json!({ "type": "Time", "format": format }),
        &None => json!({ "type": "Time" })
      },
      &Generator::DateTime(ref format) => match format {
        &Some(ref format) => json!({ "type": "DateTime", "format": format }),
        &None => json!({ "type": "DateTime" })
      },
      &Generator::RandomBoolean => json!({ "type": "RandomBoolean" }),
      &Generator::ProviderStateGenerator(ref expression) => json!({"type": "ProviderState", "expression": expression})
    }
  }
/// Convert this generator to a JSON struct
Convert this generator to a JSON struct
Convert this generator to a JSON struct
pub fn to_json(&self) -> Value {
    match self {
      &Generator::RandomInt(min, max) => json!({ "type": "RandomInt", "min": min, "max": max }),
      &Generator::Uuid => json!({ "type": "Uuid" }),
      &Generator::RandomDecimal(digits) => json!({ "type": "RandomDecimal", "digits": digits }),
      &Generator::RandomHexadecimal(digits) => json!({ "type": "RandomHexadecimal", "digits": digits }),
      &Generator::RandomString(size) => json!({ "type": "RandomString", "size": size }),
      &Generator::Regex(ref regex) => json!({ "type": "Regex", "regex": regex }),
      &Generator::Date(ref format) => match format {
        &Some(ref format) => json!({ "type": "Date", "format": format }),
        &None => json!({ "type": "Date" })
      },
      &Generator::Time(ref format) => match format {
        &Some(ref format) => json!({ "type": "Time", "format": format }),
        &None => json!({ "type": "Time" })
      },
      &Generator::DateTime(ref format) => match format {
        &Some(ref format) => json!({ "type": "DateTime", "format": format }),
        &None => json!({ "type": "DateTime" })
      },
      &Generator::RandomBoolean => json!({ "type": "RandomBoolean" }),
      &Generator::ProviderStateGenerator(ref expression) => json!({"type": "ProviderState", "expression": expression})
    }
  }
pub fn to_json ( & self ) -> Value { match self { & Generator :: RandomInt ( min , max ) => json ! ( { " " " " " " min " " max } ) , & Generator :: Uuid => json ! ( { " " " " } ) , & Generator :: RandomDecimal ( digits ) => json ! ( { " " " " " " digits } ) , & Generator :: RandomHexadecimal ( digits ) => json ! ( { " " " " " " digits } ) , & Generator :: RandomString ( size ) => json ! ( { " " " " " " size } ) , & Generator :: Regex ( ref regex ) => json ! ( { " " " " " " regex } ) , & Generator :: Date ( ref format ) => match format { & Some ( ref format ) => json ! ( { " " " " " " format } ) , & None => json ! ( { " " " " } ) } , & Generator :: Time ( ref format ) => match format { & Some ( ref format ) => json ! ( { " " " " " " format } ) , & None => json ! ( { " " " " } ) } , & Generator :: DateTime ( ref format ) => match format { & Some ( ref format ) => json ! ( { " " " " " " format } ) , & None => json ! ( { " " " " } ) } , & Generator :: RandomBoolean => json ! ( { " " " " } ) , & Generator :: ProviderStateGenerator ( ref expression ) => json ! ( { " " " " " " expression } ) } }
Convert this generator to a JSON struct
Convert this generator to a JSON struct
&self
&self