Skip to main content

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

1/// Subtracts right from left pointwise.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    conjure_object::private::DeriveWith,
8    conjure_object::log_safety::derive::LogSafe
9)]
10#[serde(crate = "conjure_object::serde")]
11#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
12#[conjure_object::private::staged_builder::staged_builder]
13#[builder(crate = conjure_object::private::staged_builder, update, inline)]
14pub struct Subtract {
15    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
16    #[serde(rename = "left")]
17    #[assert_is_safe]
18    left: Box<super::NumericSeries>,
19    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
20    #[serde(rename = "right")]
21    #[assert_is_safe]
22    right: Box<super::NumericSeries>,
23}
24impl Subtract {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(left: super::NumericSeries, right: super::NumericSeries) -> Self {
28        Self::builder().left(left).right(right).build()
29    }
30    /// Left-hand operand (minuend).
31    #[inline]
32    pub fn left(&self) -> &super::NumericSeries {
33        &*self.left
34    }
35    /// Right-hand operand (subtrahend).
36    #[inline]
37    pub fn right(&self) -> &super::NumericSeries {
38        &*self.right
39    }
40}