Skip to main content

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

1#[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 BatchSearchChannelsResponse {
16    #[builder(default, set(item(type = super::BatchedLocator)))]
17    #[serde(
18        rename = "allExpandedLocators",
19        skip_serializing_if = "std::collections::BTreeSet::is_empty",
20        default
21    )]
22    all_expanded_locators: std::collections::BTreeSet<super::BatchedLocator>,
23    #[builder(default, list(item(type = super::BatchedChannelEntry)))]
24    #[serde(rename = "results", skip_serializing_if = "Vec::is_empty", default)]
25    results: Vec<super::BatchedChannelEntry>,
26}
27impl BatchSearchChannelsResponse {
28    /// Constructs a new instance of the type.
29    #[inline]
30    pub fn new() -> Self {
31        Self::builder().build()
32    }
33    /// All locators expanded from the union of entry scopes in the batch, independent of
34    /// which channels exist within them.
35    #[inline]
36    pub fn all_expanded_locators(
37        &self,
38    ) -> &std::collections::BTreeSet<super::BatchedLocator> {
39        &self.all_expanded_locators
40    }
41    /// Channels matching the shared query, ordered by global relevance score (descending)
42    /// from the underlying search. Each entry's `locatorMetadata` covers all locators across
43    /// all entries where the channel exists; locators are tagged with the set of entry ids
44    /// that expanded to them.
45    #[inline]
46    pub fn results(&self) -> &[super::BatchedChannelEntry] {
47        &*self.results
48    }
49}