Skip to main content

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

1/// Summary of a set of ranges
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    conjure_object::private::DeriveWith
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct RangeSummary {
14    #[builder(custom(type = super::Range, convert = Box::new))]
15    #[serde(rename = "range")]
16    range: Box<super::Range>,
17    #[serde(rename = "subRangeCount")]
18    sub_range_count: i32,
19}
20impl RangeSummary {
21    /// Constructs a new instance of the type.
22    #[inline]
23    pub fn new(range: super::Range, sub_range_count: i32) -> Self {
24        Self::builder().range(range).sub_range_count(sub_range_count).build()
25    }
26    /// The range representing the minimum start and maximum end times of the ranges.
27    #[inline]
28    pub fn range(&self) -> &super::Range {
29        &*self.range
30    }
31    /// The number of ranges found within this time range.
32    #[inline]
33    pub fn sub_range_count(&self) -> i32 {
34        self.sub_range_count
35    }
36}