Add comments about regex usage in {white|black}list functions

This commit is contained in:
Aurora 2020-01-21 18:51:46 +01:00 committed by Emilio Cobos Álvarez
parent 6ff3efd0ef
commit e0a0400e94

View File

@ -794,6 +794,10 @@ impl Builder {
/// Hide the given type from the generated bindings. Regular expressions are /// Hide the given type from the generated bindings. Regular expressions are
/// supported. /// supported.
///
/// To blacklist types prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
pub fn blacklist_type<T: AsRef<str>>(mut self, arg: T) -> Builder { pub fn blacklist_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.blacklisted_types.insert(arg); self.options.blacklisted_types.insert(arg);
self self
@ -801,6 +805,10 @@ impl Builder {
/// Hide the given function from the generated bindings. Regular expressions /// Hide the given function from the generated bindings. Regular expressions
/// are supported. /// are supported.
///
/// To blacklist functions prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
pub fn blacklist_function<T: AsRef<str>>(mut self, arg: T) -> Builder { pub fn blacklist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.blacklisted_functions.insert(arg); self.options.blacklisted_functions.insert(arg);
self self
@ -809,6 +817,10 @@ impl Builder {
/// Hide the given item from the generated bindings, regardless of /// Hide the given item from the generated bindings, regardless of
/// whether it's a type, function, module, etc. Regular /// whether it's a type, function, module, etc. Regular
/// expressions are supported. /// expressions are supported.
///
/// To blacklist items prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
pub fn blacklist_item<T: AsRef<str>>(mut self, arg: T) -> Builder { pub fn blacklist_item<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.blacklisted_items.insert(arg); self.options.blacklisted_items.insert(arg);
self self
@ -816,6 +828,10 @@ impl Builder {
/// Treat the given type as opaque in the generated bindings. Regular /// Treat the given type as opaque in the generated bindings. Regular
/// expressions are supported. /// expressions are supported.
///
/// To change types prefixed with "mylib" into opaque, use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
pub fn opaque_type<T: AsRef<str>>(mut self, arg: T) -> Builder { pub fn opaque_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.opaque_types.insert(arg); self.options.opaque_types.insert(arg);
self self
@ -832,6 +848,10 @@ impl Builder {
/// Whitelist the given type so that it (and all types that it transitively /// Whitelist the given type so that it (and all types that it transitively
/// refers to) appears in the generated bindings. Regular expressions are /// refers to) appears in the generated bindings. Regular expressions are
/// supported. /// supported.
///
/// To whitelist types prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
pub fn whitelist_type<T: AsRef<str>>(mut self, arg: T) -> Builder { pub fn whitelist_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.whitelisted_types.insert(arg); self.options.whitelisted_types.insert(arg);
self self
@ -840,6 +860,10 @@ impl Builder {
/// Whitelist the given function so that it (and all types that it /// Whitelist the given function so that it (and all types that it
/// transitively refers to) appears in the generated bindings. Regular /// transitively refers to) appears in the generated bindings. Regular
/// expressions are supported. /// expressions are supported.
///
/// To whitelist functions prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
pub fn whitelist_function<T: AsRef<str>>(mut self, arg: T) -> Builder { pub fn whitelist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.whitelisted_functions.insert(arg); self.options.whitelisted_functions.insert(arg);
self self
@ -856,6 +880,10 @@ impl Builder {
/// Whitelist the given variable so that it (and all types that it /// Whitelist the given variable so that it (and all types that it
/// transitively refers to) appears in the generated bindings. Regular /// transitively refers to) appears in the generated bindings. Regular
/// expressions are supported. /// expressions are supported.
///
/// To whitelist variables prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
pub fn whitelist_var<T: AsRef<str>>(mut self, arg: T) -> Builder { pub fn whitelist_var<T: AsRef<str>>(mut self, arg: T) -> Builder {
self.options.whitelisted_vars.insert(arg); self.options.whitelisted_vars.insert(arg);
self self