Skip to main content

nominal_api/conjure/objects/scout/units/api/
unit_dimension.rs

1/// The fundamental base dimensions and their exponents, whose product compose a unit.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct UnitDimension {
17    #[builder(default, map(key(type = String, into), value(type = i32)))]
18    #[serde(
19        rename = "baseDimensions",
20        skip_serializing_if = "std::collections::BTreeMap::is_empty",
21        default
22    )]
23    base_dimensions: std::collections::BTreeMap<String, i32>,
24}
25impl UnitDimension {
26    /// Constructs a new instance of the type.
27    #[inline]
28    pub fn new() -> Self {
29        Self::builder().build()
30    }
31    #[inline]
32    pub fn base_dimensions(&self) -> &std::collections::BTreeMap<String, i32> {
33        &self.base_dimensions
34    }
35}