nvim_oxi_api/opts/
get_autocmds.rs

1use types::{Array, Object};
2
3use crate::Buffer;
4use crate::trait_utils::StringOrInt;
5
6/// Options passed to [`get_autocmds()`](crate::get_autocmds).
7#[derive(Clone, Debug, Default, macros::OptsBuilder)]
8#[repr(C)]
9pub struct GetAutocmdsOpts {
10    #[builder(mask)]
11    mask: u64,
12
13    /// Get all the autocommands triggered by one or more of the specified
14    /// events.
15    #[builder(
16        generics = "'a, E: IntoIterator<Item = &'a str>",
17        method = "events",
18        argtype = "E",
19        inline = "Array::from_iter({0}).into()"
20    )]
21    event: Object,
22
23    /// Only get the autocommands belonging to a specific augroup. The
24    /// augroup can be specified by both id and name.
25    #[builder(
26        generics = "G: StringOrInt",
27        method = "group",
28        argtype = "G",
29        inline = "{0}.to_object()"
30    )]
31    group: Object,
32
33    /// Only get the autocommands that match specific patterns. For example, if
34    /// you have `"*.py"` as a pattern for a particular autocommand, you must
35    /// pass that exact pattern to clear it. Cannot be used together with
36    /// `buffer`.
37    #[builder(
38        generics = "'a, P: IntoIterator<Item = &'a str>",
39        method = "patterns",
40        argtype = "P",
41        inline = "Array::from_iter({0}).into()"
42    )]
43    pattern: Object,
44
45    /// Get the autocommands local to a specific `Buffer`. Cannot be used
46    /// together with `patterns`.
47    #[builder(argtype = "Buffer", inline = "{0}.into()")]
48    buffer: Object,
49}