nominal_api/conjure/objects/timeseries/logicalseries/api/
nominal_locator.rs1#[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 NominalLocator {
16 #[builder(into)]
17 #[serde(rename = "channel")]
18 channel: String,
19 #[builder(default, map(key(type = String, into), value(type = String, into)))]
20 #[serde(
21 rename = "tags",
22 skip_serializing_if = "std::collections::BTreeMap::is_empty",
23 default
24 )]
25 tags: std::collections::BTreeMap<String, String>,
26 #[serde(rename = "type")]
27 type_: super::super::super::super::storage::series::api::NominalDataType,
28}
29impl NominalLocator {
30 #[inline]
32 pub fn new(
33 channel: impl Into<String>,
34 type_: super::super::super::super::storage::series::api::NominalDataType,
35 ) -> Self {
36 Self::builder().channel(channel).type_(type_).build()
37 }
38 #[inline]
39 pub fn channel(&self) -> &str {
40 &*self.channel
41 }
42 #[inline]
43 pub fn tags(&self) -> &std::collections::BTreeMap<String, String> {
44 &self.tags
45 }
46 #[inline]
47 pub fn type_(
48 &self,
49 ) -> &super::super::super::super::storage::series::api::NominalDataType {
50 &self.type_
51 }
52}