Skip to main content

nominal_api/conjure/objects/scout/compute/api/
bucketed_numeric_plot.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct BucketedNumericPlot {
13    #[builder(default, list(item(type = super::super::super::super::api::Timestamp)))]
14    #[serde(rename = "timestamps", skip_serializing_if = "Vec::is_empty", default)]
15    timestamps: Vec<super::super::super::super::api::Timestamp>,
16    #[builder(default, list(item(type = super::NumericBucket)))]
17    #[serde(rename = "buckets", skip_serializing_if = "Vec::is_empty", default)]
18    buckets: Vec<super::NumericBucket>,
19}
20impl BucketedNumericPlot {
21    /// Constructs a new instance of the type.
22    #[inline]
23    pub fn new() -> Self {
24        Self::builder().build()
25    }
26    /// The end of the bucket, exclusive.
27    #[inline]
28    pub fn timestamps(&self) -> &[super::super::super::super::api::Timestamp] {
29        &*self.timestamps
30    }
31    #[inline]
32    pub fn buckets(&self) -> &[super::NumericBucket] {
33        &*self.buckets
34    }
35}