Skip to main content

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

1/// A `Locator` annotated with the set of request ids whose batched-request scope expanded
2/// to it.
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 BatchedLocator {
18    #[builder(custom(type = super::Locator, convert = Box::new))]
19    #[serde(rename = "locator")]
20    locator: Box<super::Locator>,
21    #[builder(default, set(item(type = String, into)))]
22    #[serde(
23        rename = "requestIds",
24        skip_serializing_if = "std::collections::BTreeSet::is_empty",
25        default
26    )]
27    request_ids: std::collections::BTreeSet<String>,
28}
29impl BatchedLocator {
30    /// Constructs a new instance of the type.
31    #[inline]
32    pub fn new(locator: super::Locator) -> Self {
33        Self::builder().locator(locator).build()
34    }
35    #[inline]
36    pub fn locator(&self) -> &super::Locator {
37        &*self.locator
38    }
39    #[inline]
40    pub fn request_ids(&self) -> &std::collections::BTreeSet<String> {
41        &self.request_ids
42    }
43}