Skip to content

Commit e0a0400

Browse files
Shadlock0133emilio
authored andcommitted
Add comments about regex usage in {white|black}list functions
1 parent 6ff3efd commit e0a0400

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/lib.rs

+28
Original file line numberDiff line numberDiff line change
@@ -794,13 +794,21 @@ impl Builder {
794794

795795
/// Hide the given type from the generated bindings. Regular expressions are
796796
/// supported.
797+
///
798+
/// To blacklist types prefixed with "mylib" use `"mylib_.*"`.
799+
/// For more complicated expressions check
800+
/// [regex](https://docs.rs/regex/*/regex/) docs
797801
pub fn blacklist_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
798802
self.options.blacklisted_types.insert(arg);
799803
self
800804
}
801805

802806
/// Hide the given function from the generated bindings. Regular expressions
803807
/// are supported.
808+
///
809+
/// To blacklist functions prefixed with "mylib" use `"mylib_.*"`.
810+
/// For more complicated expressions check
811+
/// [regex](https://docs.rs/regex/*/regex/) docs
804812
pub fn blacklist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
805813
self.options.blacklisted_functions.insert(arg);
806814
self
@@ -809,13 +817,21 @@ impl Builder {
809817
/// Hide the given item from the generated bindings, regardless of
810818
/// whether it's a type, function, module, etc. Regular
811819
/// expressions are supported.
820+
///
821+
/// To blacklist items prefixed with "mylib" use `"mylib_.*"`.
822+
/// For more complicated expressions check
823+
/// [regex](https://docs.rs/regex/*/regex/) docs
812824
pub fn blacklist_item<T: AsRef<str>>(mut self, arg: T) -> Builder {
813825
self.options.blacklisted_items.insert(arg);
814826
self
815827
}
816828

817829
/// Treat the given type as opaque in the generated bindings. Regular
818830
/// expressions are supported.
831+
///
832+
/// To change types prefixed with "mylib" into opaque, use `"mylib_.*"`.
833+
/// For more complicated expressions check
834+
/// [regex](https://docs.rs/regex/*/regex/) docs
819835
pub fn opaque_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
820836
self.options.opaque_types.insert(arg);
821837
self
@@ -832,6 +848,10 @@ impl Builder {
832848
/// Whitelist the given type so that it (and all types that it transitively
833849
/// refers to) appears in the generated bindings. Regular expressions are
834850
/// supported.
851+
///
852+
/// To whitelist types prefixed with "mylib" use `"mylib_.*"`.
853+
/// For more complicated expressions check
854+
/// [regex](https://docs.rs/regex/*/regex/) docs
835855
pub fn whitelist_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
836856
self.options.whitelisted_types.insert(arg);
837857
self
@@ -840,6 +860,10 @@ impl Builder {
840860
/// Whitelist the given function so that it (and all types that it
841861
/// transitively refers to) appears in the generated bindings. Regular
842862
/// expressions are supported.
863+
///
864+
/// To whitelist functions prefixed with "mylib" use `"mylib_.*"`.
865+
/// For more complicated expressions check
866+
/// [regex](https://docs.rs/regex/*/regex/) docs
843867
pub fn whitelist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
844868
self.options.whitelisted_functions.insert(arg);
845869
self
@@ -856,6 +880,10 @@ impl Builder {
856880
/// Whitelist the given variable so that it (and all types that it
857881
/// transitively refers to) appears in the generated bindings. Regular
858882
/// expressions are supported.
883+
///
884+
/// To whitelist variables prefixed with "mylib" use `"mylib_.*"`.
885+
/// For more complicated expressions check
886+
/// [regex](https://docs.rs/regex/*/regex/) docs
859887
pub fn whitelist_var<T: AsRef<str>>(mut self, arg: T) -> Builder {
860888
self.options.whitelisted_vars.insert(arg);
861889
self

0 commit comments

Comments
 (0)