nvim_oxi_api/opts/
get_extmark_by_id.rs

1/// Options passed to
2/// [`Buffer::get_extmark_by_id()`](crate::Buffer::get_extmark_by_id).
3#[cfg(not(feature = "neovim-0-10"))] // 0nly on 0.9.
4#[derive(Clone, Debug, Default)]
5pub struct GetExtmarkByIdOpts {
6    details: types::Object,
7}
8
9#[cfg(not(feature = "neovim-0-10"))] // 0nly on 0.9.
10impl GetExtmarkByIdOpts {
11    #[inline]
12    pub fn builder() -> GetExtmarkByIdOptsBuilder {
13        GetExtmarkByIdOptsBuilder::default()
14    }
15}
16
17#[cfg(not(feature = "neovim-0-10"))] // 0nly on 0.9.
18#[derive(Clone, Default)]
19pub struct GetExtmarkByIdOptsBuilder(GetExtmarkByIdOpts);
20
21#[cfg(not(feature = "neovim-0-10"))] // 0nly on 0.9.
22impl GetExtmarkByIdOptsBuilder {
23    /// Whether to include the extmark's
24    /// [`ExtmarkInfos`](crate::types::ExtmarkInfos) as the last element of the
25    /// tuple returned by
26    /// [`Buffer::get_extmark_by_id`](crate::Buffer::get_extmark_by_id).
27    #[inline]
28    pub fn details(&mut self, details: bool) -> &mut Self {
29        self.0.details = details.into();
30        self
31    }
32
33    #[inline]
34    pub fn build(&mut self) -> GetExtmarkByIdOpts {
35        std::mem::take(&mut self.0)
36    }
37}
38
39#[cfg(not(feature = "neovim-0-10"))] // 0nly on 0.9.
40impl From<&GetExtmarkByIdOpts> for types::Dictionary {
41    fn from(opts: &GetExtmarkByIdOpts) -> Self {
42        Self::from_iter([("details", opts.details.clone())])
43    }
44}
45
46/// Options passed to
47/// [`Buffer::get_extmark_by_id()`](crate::Buffer::get_extmark_by_id).
48#[cfg(feature = "neovim-0-10")] // On 0.10 and nightly.
49#[derive(Clone, Debug, Default, macros::OptsBuilder)]
50#[repr(C)]
51pub struct GetExtmarkByIdOpts {
52    #[builder(mask)]
53    mask: u64,
54
55    /// Whether to include the extmark's
56    /// [`ExtmarkInfos`](crate::types::ExtmarkInfos) as the last element of the
57    /// tuple returned by
58    /// [`Buffer::get_extmark_by_id`](crate::Buffer::get_extmark_by_id).
59    #[builder(argtype = "bool")]
60    details: types::Boolean,
61
62    #[builder(argtype = "bool")]
63    hl_name: types::Boolean,
64}