Skip to main content

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

1/// A user-defined enum aggregation. The supported ABI is a Rust function with one vector input and a
2/// `String` return value. Numeric input series use `Vec<f64>` and enum input series use `Vec<String>`.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct EnumAggregationUdf {
18    #[builder(custom(type = super::UdfSource, convert = Box::new))]
19    #[serde(rename = "source")]
20    source: Box<super::UdfSource>,
21}
22impl EnumAggregationUdf {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(source: super::UdfSource) -> Self {
26        Self::builder().source(source).build()
27    }
28    #[inline]
29    pub fn source(&self) -> &super::UdfSource {
30        &*self.source
31    }
32}