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
/// Options passed to [`create_augroup()`](crate::create_augroup).
#[derive(Clone, Debug, Default)]
#[repr(C)]
pub struct CreateAugroupOpts {
    clear: types::Object,
}

impl CreateAugroupOpts {
    #[inline(always)]
    pub fn builder() -> CreateAugroupOptsBuilder {
        CreateAugroupOptsBuilder::default()
    }
}

#[derive(Clone, Default)]
pub struct CreateAugroupOptsBuilder(CreateAugroupOpts);

impl CreateAugroupOptsBuilder {
    /// Whether to clear existing commands if the group already exists.
    #[inline]
    pub fn clear(&mut self, clear: bool) -> &mut Self {
        self.0.clear = clear.into();
        self
    }

    #[inline]
    pub fn build(&mut self) -> CreateAugroupOpts {
        std::mem::take(&mut self.0)
    }
}