Skip to main content

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

1/// Raises base to the power of exponent pointwise.
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 Power {
14    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
15    #[serde(rename = "base")]
16    base: Box<super::NumericSeries>,
17    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
18    #[serde(rename = "exponent")]
19    exponent: Box<super::NumericSeries>,
20}
21impl Power {
22    /// Constructs a new instance of the type.
23    #[inline]
24    pub fn new(base: super::NumericSeries, exponent: super::NumericSeries) -> Self {
25        Self::builder().base(base).exponent(exponent).build()
26    }
27    /// Base values.
28    #[inline]
29    pub fn base(&self) -> &super::NumericSeries {
30        &*self.base
31    }
32    /// Exponent values.
33    #[inline]
34    pub fn exponent(&self) -> &super::NumericSeries {
35        &*self.exponent
36    }
37}