From e0a0400e946a3786bfde0984386e9c235188043e Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 21 Jan 2020 18:51:46 +0100 Subject: [PATCH] Add comments about regex usage in {white|black}list functions --- src/lib.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index a818409b..97fbdf01 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -794,6 +794,10 @@ impl Builder { /// Hide the given type from the generated bindings. Regular expressions are /// 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>(mut self, arg: T) -> Builder { self.options.blacklisted_types.insert(arg); self @@ -801,6 +805,10 @@ impl Builder { /// Hide the given function from the generated bindings. Regular expressions /// 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>(mut self, arg: T) -> Builder { self.options.blacklisted_functions.insert(arg); self @@ -809,6 +817,10 @@ impl Builder { /// Hide the given item from the generated bindings, regardless of /// whether it's a type, function, module, etc. Regular /// 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>(mut self, arg: T) -> Builder { self.options.blacklisted_items.insert(arg); self @@ -816,6 +828,10 @@ impl Builder { /// Treat the given type as opaque in the generated bindings. Regular /// 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>(mut self, arg: T) -> Builder { self.options.opaque_types.insert(arg); self @@ -832,6 +848,10 @@ impl Builder { /// Whitelist the given type so that it (and all types that it transitively /// refers to) appears in the generated bindings. Regular expressions are /// 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>(mut self, arg: T) -> Builder { self.options.whitelisted_types.insert(arg); self @@ -840,6 +860,10 @@ impl Builder { /// Whitelist the given function so that it (and all types that it /// transitively refers to) appears in the generated bindings. Regular /// 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>(mut self, arg: T) -> Builder { self.options.whitelisted_functions.insert(arg); self @@ -856,6 +880,10 @@ impl Builder { /// Whitelist the given variable so that it (and all types that it /// transitively refers to) appears in the generated bindings. Regular /// 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>(mut self, arg: T) -> Builder { self.options.whitelisted_vars.insert(arg); self