Skip to main content

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

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