Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the blocklist_* and allowlist_* documentation. #2554

Merged
merged 2 commits into from
Jun 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions bindgen/options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ options! {
methods: {
regex_option! {
/// Do not generate any bindings for the given type.
///
/// This option is not recursive, meaning that it will only block types whose names
/// explicitly match the argument of this method.
pub fn blocklist_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.blocklisted_types.insert(arg);
self
Expand All @@ -171,6 +174,9 @@ options! {
methods: {
regex_option! {
/// Do not generate any bindings for the given function.
///
/// This option is not recursive, meaning that it will only block functions whose
/// names explicitly match the argument of this method.
pub fn blocklist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.blocklisted_functions.insert(arg);
self
Expand All @@ -185,6 +191,9 @@ options! {
regex_option! {
/// Do not generate any bindings for the given item, regardless of whether it is a
/// type, function, module, etc.
///
/// This option is not recursive, meaning that it will only block items whose names
/// explicitly match the argument of this method.
pub fn blocklist_item<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.blocklisted_items.insert(arg);
self
Expand All @@ -199,6 +208,12 @@ options! {
regex_option! {
/// Do not generate any bindings for the contents of the given file, regardless of
/// whether the contents of the file are types, functions, modules, etc.
///
/// This option is not recursive, meaning that it will only block files whose names
/// explicitly match the argument of this method.
///
/// This method will use the argument to match the complete path of the file
/// instead of a section of it.
pub fn blocklist_file<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.blocklisted_files.insert(arg);
self
Expand Down Expand Up @@ -319,6 +334,9 @@ options! {
///
/// This option is transitive by default. Check the documentation of the
/// [`Builder::allowlist_recursively`] method for further information.
///
/// This method will use the argument to match the complete path of the file
/// instead of a section of it.
pub fn allowlist_file<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.allowlisted_files.insert(arg);
self
Expand Down