Skip to main content

nominal_api_conjure/conjure/objects/scout/compute/api/
intersect_ranges.rs

1/// Produces the intersection of the input ranges: the ranges of time covered by
2/// every input. For best performance, pass inputs in the order in which they
3/// should be evaluated, listing the ranges that are cheapest to compute first.
4#[derive(
5    Debug,
6    Clone,
7    conjure_object::serde::Serialize,
8    conjure_object::serde::Deserialize,
9    conjure_object::private::DeriveWith,
10    conjure_object::log_safety::derive::LogSafe
11)]
12#[serde(crate = "conjure_object::serde")]
13#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct IntersectRanges {
17    #[builder(default, list(item(type = super::RangeSeries)))]
18    #[serde(rename = "inputs", skip_serializing_if = "Vec::is_empty", default)]
19    #[assert_is_safe]
20    inputs: Vec<super::RangeSeries>,
21}
22impl IntersectRanges {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new() -> Self {
26        Self::builder().build()
27    }
28    #[inline]
29    pub fn inputs(&self) -> &[super::RangeSeries] {
30        &*self.inputs
31    }
32}