nvim_oxi_api/opts/
buf_delete.rs1#[derive(Clone, Debug, Default)]
3#[cfg(not(feature = "neovim-0-10"))] pub struct BufDeleteOpts {
5 force: types::Object,
6 unload: types::Object,
7}
8
9#[cfg(not(feature = "neovim-0-10"))] impl BufDeleteOpts {
11 #[inline(always)]
12 pub fn builder() -> BufDeleteOptsBuilder {
13 BufDeleteOptsBuilder::default()
14 }
15}
16
17#[derive(Clone, Default)]
18#[cfg(not(feature = "neovim-0-10"))] pub struct BufDeleteOptsBuilder(BufDeleteOpts);
20
21#[cfg(not(feature = "neovim-0-10"))] impl BufDeleteOptsBuilder {
23 #[inline]
25 pub fn force(&mut self, force: bool) -> &mut Self {
26 self.0.force = force.into();
27 self
28 }
29
30 #[inline]
32 pub fn unload(&mut self, unload: bool) -> &mut Self {
33 self.0.unload = unload.into();
34 self
35 }
36
37 #[inline]
38 pub fn build(&mut self) -> BufDeleteOpts {
39 std::mem::take(&mut self.0)
40 }
41}
42
43#[cfg(not(feature = "neovim-0-10"))] impl From<&BufDeleteOpts> for types::Dictionary {
45 fn from(opts: &BufDeleteOpts) -> Self {
46 Self::from_iter([
47 ("force", opts.force.clone()),
48 ("unload", opts.unload.clone()),
49 ])
50 }
51}
52
53#[cfg(feature = "neovim-0-10")] #[derive(Clone, Debug, Default, macros::OptsBuilder)]
56#[repr(C)]
57pub struct BufDeleteOpts {
58 #[builder(mask)]
59 mask: u64,
60
61 #[builder(argtype = "bool")]
63 force: types::Boolean,
64
65 #[builder(argtype = "bool")]
67 unload: types::Boolean,
68}