1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#[derive(
Debug,
Clone,
conjure_object::serde::Serialize,
conjure_object::serde::Deserialize,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct SearchChannelsResponse {
#[builder(default, set(item(type = super::Locator)))]
#[serde(
rename = "allExpandedLocators",
skip_serializing_if = "std::collections::BTreeSet::is_empty",
default
)]
all_expanded_locators: std::collections::BTreeSet<super::Locator>,
#[builder(default, list(item(type = super::ChannelEntry)))]
#[serde(rename = "results", skip_serializing_if = "Vec::is_empty", default)]
results: Vec<super::ChannelEntry>,
}
impl SearchChannelsResponse {
/// Constructs a new instance of the type.
#[inline]
pub fn new() -> Self {
Self::builder().build()
}
/// All locators expanded from the request scope, independent of which channels exist within them.
/// Useful for callers that need to know the complete locator topology (e.g. to render empty
/// locators in a tree view) even when no matching channel was found in some of them or if the channel
/// only exists in a subset of locators.
#[inline]
pub fn all_expanded_locators(&self) -> &std::collections::BTreeSet<super::Locator> {
&self.all_expanded_locators
}
/// Channels matching the query, ordered by relevance from the underlying search: for fuzzy
/// queries, exact matches first, then channels containing the query text, then other matches,
/// with each tier ordered by descending similarity score; for substring queries, by earliest
/// match position; for subsequence queries, exact matches first, then channels containing the
/// query text ordered by earliest match position, then remaining subsequence matches. Ties are
/// broken by natural (numeric-aware) channel name order.
#[inline]
pub fn results(&self) -> &[super::ChannelEntry] {
&*self.results
}
}