nvim_oxi_api/opts/
get_extmarks.rs1#[cfg(not(feature = "neovim-0-10"))] #[derive(Clone, Debug, Default)]
5#[repr(C)]
6pub struct GetExtmarksOpts {
7 details: types::Object,
8 limits: types::Object,
9}
10
11#[cfg(not(feature = "neovim-0-10"))] impl GetExtmarksOpts {
13 #[inline(always)]
14 pub fn builder() -> GetExtmarksOptsBuilder {
16 GetExtmarksOptsBuilder::default()
17 }
18}
19
20#[cfg(not(feature = "neovim-0-10"))] #[derive(Clone, Default)]
22pub struct GetExtmarksOptsBuilder(GetExtmarksOpts);
23
24#[cfg(not(feature = "neovim-0-10"))] impl GetExtmarksOptsBuilder {
26 #[inline]
31 pub fn details(&mut self, details: bool) -> &mut Self {
32 #[cfg(not(feature = "neovim-0-10"))] {
34 self.0.details = details.into();
35 }
36 #[cfg(feature = "neovim-0-10")] {
38 self.0.details = details;
39 self.0.mask |= 0b1001;
40 }
41 self
42 }
43
44 #[cfg(feature = "neovim-0-10")] #[inline]
46 pub fn hl_name(&mut self, hl_name: bool) -> &mut Self {
47 self.0.hl_name = hl_name;
48 self.0.mask |= 0b10001;
49 self
50 }
51
52 #[inline]
53 pub fn limits(&mut self, limits: bool) -> &mut Self {
54 #[cfg(not(feature = "neovim-0-10"))] {
56 self.0.limits = limits.into();
57 }
58 #[cfg(feature = "neovim-0-10")] {
60 self.0.limits = limits as Integer;
61 self.0.mask |= 0b101;
62 }
63 self
64 }
65
66 #[cfg(feature = "neovim-0-10")] #[inline]
68 pub fn overlap(&mut self, overlap: bool) -> &mut Self {
69 self.0.overlap = overlap;
70 self.0.mask |= 0b100001;
71 self
72 }
73
74 #[cfg(feature = "neovim-0-10")] #[inline]
76 pub fn ty<S: Into<nvim::String>>(&mut self, ty: S) -> &mut Self {
77 self.0.ty = ty.into();
78 self.0.mask |= 0b11;
79 self
80 }
81
82 #[inline]
84 pub fn build(&mut self) -> GetExtmarksOpts {
85 std::mem::take(&mut self.0)
86 }
87}
88
89#[cfg(not(feature = "neovim-0-10"))] impl From<&GetExtmarksOpts> for types::Dictionary {
91 fn from(opts: &GetExtmarksOpts) -> Self {
92 Self::from_iter([
93 ("details", opts.details.clone()),
94 ("limits", opts.limits.clone()),
95 ])
96 }
97}
98
99#[cfg(feature = "neovim-0-10")] #[derive(Clone, Debug, Default, macros::OptsBuilder)]
101#[repr(C)]
102pub struct GetExtmarksOpts {
105 #[builder(mask)]
106 mask: u64,
107
108 #[builder(
109 method = "limits",
110 argtype = "bool",
111 inline = "{0} as types::Integer"
112 )]
113 limit: types::Integer,
114
115 #[builder(argtype = "bool")]
120 details: types::Boolean,
121
122 #[builder(argtype = "bool")]
123 hl_name: types::Boolean,
124
125 #[builder(argtype = "bool")]
126 overlap: types::Boolean,
127
128 #[builder(
132 generics = "S: Into<types::String>",
133 argtype = "S",
134 inline = "{0}.into()"
135 )]
136 ty: types::String,
137}