nvim_oxi_api/opts/
get_commands.rs1#[derive(Clone, Debug, Default)]
4#[repr(C)]
5pub struct GetCommandsOpts {
6 #[cfg(not(feature = "neovim-0-10"))] builtin: types::Object,
8
9 #[cfg(feature = "neovim-0-10")] builtin: bool,
11}
12
13impl GetCommandsOpts {
14 #[inline(always)]
15 pub fn builder() -> GetCommandsOptsBuilder {
16 GetCommandsOptsBuilder::default()
17 }
18}
19
20#[derive(Clone, Default)]
21pub struct GetCommandsOptsBuilder(GetCommandsOpts);
22
23impl GetCommandsOptsBuilder {
24 #[inline]
25 pub fn builtin(&mut self, builtin: bool) -> &mut Self {
26 #[cfg(not(feature = "neovim-0-10"))] {
28 self.0.builtin = builtin.into();
29 }
30 #[cfg(feature = "neovim-0-10")] {
32 self.0.builtin = builtin;
33 }
34 self
35 }
36
37 #[inline]
38 pub fn build(&mut self) -> GetCommandsOpts {
39 std::mem::take(&mut self.0)
40 }
41}