Skip to main content

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

1/// Adds a derived enum series to the base frame. If a series with the same name already exists,
2/// then it will be replaced.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    conjure_object::private::DeriveWith
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 WithEnumSeriesFrame {
15    #[builder(custom(type = super::DataFrame, convert = Box::new))]
16    #[serde(rename = "input")]
17    input: Box<super::DataFrame>,
18    #[builder(custom(type = super::StringConstant, convert = Box::new))]
19    #[serde(rename = "name")]
20    name: Box<super::StringConstant>,
21    #[builder(custom(type = super::EnumSeries, convert = Box::new))]
22    #[serde(rename = "definition")]
23    definition: Box<super::EnumSeries>,
24}
25impl WithEnumSeriesFrame {
26    /// Constructs a new instance of the type.
27    #[inline]
28    pub fn new(
29        input: super::DataFrame,
30        name: super::StringConstant,
31        definition: super::EnumSeries,
32    ) -> Self {
33        Self::builder().input(input).name(name).definition(definition).build()
34    }
35    /// The base frame to which the new series will be added.
36    #[inline]
37    pub fn input(&self) -> &super::DataFrame {
38        &*self.input
39    }
40    /// Name of the new derived series.
41    #[inline]
42    pub fn name(&self) -> &super::StringConstant {
43        &*self.name
44    }
45    /// Compute expression defining the series values.
46    #[inline]
47    pub fn definition(&self) -> &super::EnumSeries {
48        &*self.definition
49    }
50}