fn parse_histogram(name: &String, histogram: &Vec<serde_json::Value>) -> Result<Property, Error> {
    if histogram.len() < 3 {
        bail!(
            "Histograms require a minimum of 5 entries to be validly serialized. We can only
uce 5 entries if there exist 3 or more buckets. If this isn't the case, this histogram is
ormed."
        );
    }

    if is_f64_histogram(histogram)? {
        return Ok(Property::DoubleArray(name.to_string(), parse_f64_histogram(histogram)?));
    }

    if is_i64_histogram(histogram)? {
        return Ok(Property::IntArray(name.to_string(), parse_i64_histogram(histogram)?));
    }

    if is_u64_histogram(histogram)? {
        return Ok(Property::UintArray(name.to_string(), parse_u64_histogram(histogram)?));
    }

    bail!("Histograms must be one of i64, u64, or f64. Property name: {:?}", name);
}
/// Parses a JSON representation of an Inspect histogram into its ArrayValue form.
Parses a JSON representation of an Inspect histogram into its ArrayValue form.
Parses a JSON representation of an Inspect histogram into its ArrayValue form .
fn parse_histogram(name: &String, histogram: &Vec<serde_json::Value>) -> Result<Property, Error> {
    if histogram.len() < 3 {
        bail!(
            "Histograms require a minimum of 5 entries to be validly serialized. We can only
uce 5 entries if there exist 3 or more buckets. If this isn't the case, this histogram is
ormed."
        );
    }
    if is_f64_histogram(histogram)? {
        return Ok(Property::DoubleArray(name.to_string(), parse_f64_histogram(histogram)?));
    }
    if is_i64_histogram(histogram)? {
        return Ok(Property::IntArray(name.to_string(), parse_i64_histogram(histogram)?));
    }
    if is_u64_histogram(histogram)? {
        return Ok(Property::UintArray(name.to_string(), parse_u64_histogram(histogram)?));
    }
    bail!("Histograms must be one of i64, u64, or f64. Property name: {:?}", name);
}
fn parse_histogram ( name : & String , histogram : & Vec < serde_json :: Value > ) -> Result < Property , Error > { if histogram . len ( ) < 3 { bail ! ( " " ) ; } if is_f64_histogram ( histogram ) ? { return Ok ( Property :: DoubleArray ( name . to_string ( ) , parse_f64_histogram ( histogram ) ? ) ) ; } if is_i64_histogram ( histogram ) ? { return Ok ( Property :: IntArray ( name . to_string ( ) , parse_i64_histogram ( histogram ) ? ) ) ; } if is_u64_histogram ( histogram ) ? { return Ok ( Property :: UintArray ( name . to_string ( ) , parse_u64_histogram ( histogram ) ? ) ) ; } bail ! ( " " name ) ; }
Parses a JSON representation of an Inspect histogram into its ArrayValue form.
Parses a JSON representation of an Inspect histogram into its ArrayValue form .
name
&String
histogram
&Vec<serde_json::Value>