Skip to main content

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

1/// For every timestamp specified in the input series, offset it by a constant factor.
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 OffsetSeries {
14    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
15    #[serde(rename = "input")]
16    input: Box<super::NumericSeries>,
17    #[builder(custom(type = super::DoubleConstant, convert = Box::new))]
18    #[serde(rename = "scalar")]
19    scalar: Box<super::DoubleConstant>,
20}
21impl OffsetSeries {
22    /// Constructs a new instance of the type.
23    #[inline]
24    pub fn new(input: super::NumericSeries, scalar: super::DoubleConstant) -> Self {
25        Self::builder().input(input).scalar(scalar).build()
26    }
27    #[inline]
28    pub fn input(&self) -> &super::NumericSeries {
29        &*self.input
30    }
31    /// The constant to add to each point
32    #[inline]
33    pub fn scalar(&self) -> &super::DoubleConstant {
34        &*self.scalar
35    }
36}