Skip to main content

nominal_api/conjure/objects/scout/channel/api/
batched_channel_entry.rs

1/// A channel (by name) found in one or more locators across the batch. `locatorMetadata`
2/// has one entry per locator the channel exists in.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct BatchedChannelEntry {
18    #[serde(rename = "name")]
19    name: super::super::super::super::api::Channel,
20    #[builder(default, set(item(type = super::BatchedLocatorChannelMetadata)))]
21    #[serde(
22        rename = "locatorMetadata",
23        skip_serializing_if = "std::collections::BTreeSet::is_empty",
24        default
25    )]
26    locator_metadata: std::collections::BTreeSet<super::BatchedLocatorChannelMetadata>,
27}
28impl BatchedChannelEntry {
29    /// Constructs a new instance of the type.
30    #[inline]
31    pub fn new(name: super::super::super::super::api::Channel) -> Self {
32        Self::builder().name(name).build()
33    }
34    #[inline]
35    pub fn name(&self) -> &super::super::super::super::api::Channel {
36        &self.name
37    }
38    #[inline]
39    pub fn locator_metadata(
40        &self,
41    ) -> &std::collections::BTreeSet<super::BatchedLocatorChannelMetadata> {
42        &self.locator_metadata
43    }
44}