1# Allowlisting
2
3Allowlisting allows us to be precise about which type, function, and global
4variable definitions `bindgen` generates bindings for. By default, if we don't
5specify any allowlisting rules, everything is considered allowlisted. This may
6not be desirable because of either
7
8* the generated bindings contain a lot of extra definitions we don't plan on using, or
9* the header file contains C++ features for which Rust does not have a
10  corresponding form (such as partial template specialization), and we would
11  like to avoid these definitions
12
13If we specify allowlisting rules, then `bindgen` will only generate bindings to
14types, functions, and global variables that match the allowlisting rules, or are
15transitively used by a definition that matches them.
16
17### Library
18
19* [`bindgen::Builder::allowlist_type`](https://docs.rs/bindgen/latest/bindgen/struct.Builder.html#method.allowlist_type)
20* [`bindgen::Builder::allowlist_function`](https://docs.rs/bindgen/latest/bindgen/struct.Builder.html#method.allowlist_function)
21* [`bindgen::Builder::allowlist_var`](https://docs.rs/bindgen/latest/bindgen/struct.Builder.html#method.allowlist_var)
22* [`bindgen::Builder::allowlist_file`](https://docs.rs/bindgen/latest/bindgen/struct.Builder.html#method.allowlist_file)
23
24### Command Line
25
26* `--allowlist-type <type>`
27* `--allowlist-function <function>`
28* `--allowlist-var <var>`
29* `--allowlist-file <path>`
30
31### Annotations
32
33None.
34