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    #[builder(into)]
19    #[serde(rename = "name")]
20    name: String,
21    #[builder(default, set(item(type = super::BatchedLocatorChannelMetadata)))]
22    #[serde(
23        rename = "locatorMetadata",
24        skip_serializing_if = "std::collections::BTreeSet::is_empty",
25        default
26    )]
27    locator_metadata: std::collections::BTreeSet<super::BatchedLocatorChannelMetadata>,
28}
29impl BatchedChannelEntry {
30    /// Constructs a new instance of the type.
31    #[inline]
32    pub fn new(name: impl Into<String>) -> Self {
33        Self::builder().name(name).build()
34    }
35    #[inline]
36    pub fn name(&self) -> &str {
37        &*self.name
38    }
39    #[inline]
40    pub fn locator_metadata(
41        &self,
42    ) -> &std::collections::BTreeSet<super::BatchedLocatorChannelMetadata> {
43        &self.locator_metadata
44    }
45}