Skip to main content

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

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith,
7    Copy
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct AxisRange {
14    #[builder(default, into)]
15    #[serde(rename = "start", skip_serializing_if = "Option::is_none", default)]
16    #[derive_with(with = conjure_object::private::DoubleWrapper)]
17    start: Option<f64>,
18    #[builder(default, into)]
19    #[serde(rename = "end", skip_serializing_if = "Option::is_none", default)]
20    #[derive_with(with = conjure_object::private::DoubleWrapper)]
21    end: Option<f64>,
22}
23impl AxisRange {
24    /// Constructs a new instance of the type.
25    #[inline]
26    pub fn new() -> Self {
27        Self::builder().build()
28    }
29    #[inline]
30    pub fn start(&self) -> Option<f64> {
31        self.start.as_ref().map(|o| *o)
32    }
33    #[inline]
34    pub fn end(&self) -> Option<f64> {
35        self.end.as_ref().map(|o| *o)
36    }
37}