Skip to main content

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