pub struct Generator { /* private fields */ }
Expand description
Builder struct for configuring and generating bindings.
Implementations§
Source§impl Generator
impl Generator
Sourcepub fn include_path<T: AsRef<Path>>(self, path: T) -> Self
pub fn include_path<T: AsRef<Path>>(self, path: T) -> Self
Adds path
to the list of include paths to pass to libclang
.
Sourcepub fn target<T: AsRef<str>>(self, target: T) -> Self
pub fn target<T: AsRef<str>>(self, target: T) -> Self
Specify the target triple for which bindings should be generated.
Sourcepub fn skip_types<S: AsRef<str>, T: AsRef<[S]>>(self, types: T) -> Self
pub fn skip_types<S: AsRef<str>, T: AsRef<[S]>>(self, types: T) -> Self
Do not generate bindings for types
.
Sourcepub fn skip_interface_trait<T: AsRef<str>>(self, interface: T) -> Self
pub fn skip_interface_trait<T: AsRef<str>>(self, interface: T) -> Self
Do not generate an interface trait for interface
.
Sourcepub fn skip_interface_traits<'a, T: AsRef<[&'a str]>>(
self,
interfaces: T,
) -> Self
pub fn skip_interface_traits<'a, T: AsRef<[&'a str]>>( self, interfaces: T, ) -> Self
Do not generate interface traits for interfaces
.
Sourcepub fn constant_parser<F>(self, f: F) -> Self
pub fn constant_parser<F>(self, f: F) -> Self
Registers a callback for parsing constant definitions which libclang
is not able to
evaluate.
The callback will be passed a slice of tokens, and its output (if not None
) will be
included in the generated bindings.
Sourcepub fn iid_generator<F>(self, f: F) -> Self
pub fn iid_generator<F>(self, f: F) -> Self
Registers a callback which should, when given the name of an interface as a string, return
a string containing a Rust expression evaluating to the Guid
value for that interface.
Sourcepub fn query_interface_fn<T: AsRef<str>>(self, f: T) -> Self
pub fn query_interface_fn<T: AsRef<str>>(self, f: T) -> Self
Registers a function which will be called by the implementations of
Unknown::query_interface
for generated interface types.
The function should be in scope where the resulting bindings are placed, and it should have
the same type signature as Unknown::query_interface
.
Sourcepub fn add_ref_fn<T: AsRef<str>>(self, f: T) -> Self
pub fn add_ref_fn<T: AsRef<str>>(self, f: T) -> Self
Registers a function which will be called by the implementations of Unknown::add_ref
for
generated interface types.
The function should be in scope where the resulting bindings are placed, and it should have
the same type signature as Unknown::add_ref
.
Sourcepub fn release_fn<T: AsRef<str>>(self, f: T) -> Self
pub fn release_fn<T: AsRef<str>>(self, f: T) -> Self
Registers a function which will be called by the implementations of Unknown::release
for
generated interface types.
The function should be in scope where the resulting bindings are placed, and it should have
the same type signature as Unknown::release
.