Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
numeric_array_cell_config.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct NumericArrayCellConfig {
16    #[builder(
17        default,
18        custom(
19            type = impl
20            Into<Option<super::NumericArrayVisualisation>>,
21            convert = |v|v.into().map(Box::new)
22        )
23    )]
24    #[serde(rename = "visualisation", skip_serializing_if = "Option::is_none", default)]
25    visualisation: Option<Box<super::NumericArrayVisualisation>>,
26    #[builder(
27        default,
28        custom(
29            type = impl
30            Into<Option<super::NumberFormat>>,
31            convert = |v|v.into().map(Box::new)
32        )
33    )]
34    #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none", default)]
35    number_format: Option<Box<super::NumberFormat>>,
36}
37impl NumericArrayCellConfig {
38    /// Constructs a new instance of the type.
39    #[inline]
40    pub fn new() -> Self {
41        Self::builder().build()
42    }
43    #[inline]
44    pub fn visualisation(&self) -> Option<&super::NumericArrayVisualisation> {
45        self.visualisation.as_ref().map(|o| &**o)
46    }
47    #[inline]
48    pub fn number_format(&self) -> Option<&super::NumberFormat> {
49        self.number_format.as_ref().map(|o| &**o)
50    }
51}