Skip to main content

aws_sdk_xray/types/
_histogram_entry.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An entry in a histogram for a statistic. A histogram maps the range of observed values on the X axis, and the prevalence of each value on the Y axis.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct HistogramEntry {
7    /// <p>The value of the entry.</p>
8    pub value: f64,
9    /// <p>The prevalence of the entry.</p>
10    pub count: i32,
11}
12impl HistogramEntry {
13    /// <p>The value of the entry.</p>
14    pub fn value(&self) -> f64 {
15        self.value
16    }
17    /// <p>The prevalence of the entry.</p>
18    pub fn count(&self) -> i32 {
19        self.count
20    }
21}
22impl HistogramEntry {
23    /// Creates a new builder-style object to manufacture [`HistogramEntry`](crate::types::HistogramEntry).
24    pub fn builder() -> crate::types::builders::HistogramEntryBuilder {
25        crate::types::builders::HistogramEntryBuilder::default()
26    }
27}
28
29/// A builder for [`HistogramEntry`](crate::types::HistogramEntry).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct HistogramEntryBuilder {
33    pub(crate) value: ::std::option::Option<f64>,
34    pub(crate) count: ::std::option::Option<i32>,
35}
36impl HistogramEntryBuilder {
37    /// <p>The value of the entry.</p>
38    pub fn value(mut self, input: f64) -> Self {
39        self.value = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The value of the entry.</p>
43    pub fn set_value(mut self, input: ::std::option::Option<f64>) -> Self {
44        self.value = input;
45        self
46    }
47    /// <p>The value of the entry.</p>
48    pub fn get_value(&self) -> &::std::option::Option<f64> {
49        &self.value
50    }
51    /// <p>The prevalence of the entry.</p>
52    pub fn count(mut self, input: i32) -> Self {
53        self.count = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>The prevalence of the entry.</p>
57    pub fn set_count(mut self, input: ::std::option::Option<i32>) -> Self {
58        self.count = input;
59        self
60    }
61    /// <p>The prevalence of the entry.</p>
62    pub fn get_count(&self) -> &::std::option::Option<i32> {
63        &self.count
64    }
65    /// Consumes the builder and constructs a [`HistogramEntry`](crate::types::HistogramEntry).
66    pub fn build(self) -> crate::types::HistogramEntry {
67        crate::types::HistogramEntry {
68            value: self.value.unwrap_or_default(),
69            count: self.count.unwrap_or_default(),
70        }
71    }
72}