Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
histogram_plot.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 HistogramPlot {
16    #[serde(rename = "variableName")]
17    variable_name: super::super::super::channelvariables::api::ChannelVariableName,
18    #[builder(default, into)]
19    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none", default)]
20    enabled: Option<bool>,
21    #[serde(rename = "color")]
22    color: super::super::super::api::HexColor,
23}
24impl HistogramPlot {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(
28        variable_name: super::super::super::channelvariables::api::ChannelVariableName,
29        color: super::super::super::api::HexColor,
30    ) -> Self {
31        Self::builder().variable_name(variable_name).color(color).build()
32    }
33    #[inline]
34    pub fn variable_name(
35        &self,
36    ) -> &super::super::super::channelvariables::api::ChannelVariableName {
37        &self.variable_name
38    }
39    #[inline]
40    pub fn enabled(&self) -> Option<bool> {
41        self.enabled.as_ref().map(|o| *o)
42    }
43    #[inline]
44    pub fn color(&self) -> &super::super::super::api::HexColor {
45        &self.color
46    }
47}