Skip to main content

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

1/// Select the Nth range (0-indexed) from a range series.
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 NthRange {
14    #[builder(custom(type = super::RangeSeries, convert = Box::new))]
15    #[serde(rename = "input")]
16    input: Box<super::RangeSeries>,
17    #[builder(custom(type = super::IntegerConstant, convert = Box::new))]
18    #[serde(rename = "index")]
19    index: Box<super::IntegerConstant>,
20    #[serde(rename = "sortOrder")]
21    sort_order: super::RangeSortOrder,
22}
23impl NthRange {
24    /// Constructs a new instance of the type.
25    #[inline]
26    pub fn new(
27        input: super::RangeSeries,
28        index: super::IntegerConstant,
29        sort_order: super::RangeSortOrder,
30    ) -> Self {
31        Self::builder().input(input).index(index).sort_order(sort_order).build()
32    }
33    #[inline]
34    pub fn input(&self) -> &super::RangeSeries {
35        &*self.input
36    }
37    #[inline]
38    pub fn index(&self) -> &super::IntegerConstant {
39        &*self.index
40    }
41    #[inline]
42    pub fn sort_order(&self) -> &super::RangeSortOrder {
43        &self.sort_order
44    }
45}