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 override_typedef_type<T: AsRef<str>, U: AsRef<str>>(
self,
typedef: T,
type_: U,
) -> Self
pub fn override_typedef_type<T: AsRef<str>, U: AsRef<str>>( self, typedef: T, type_: U, ) -> Self
Override the type of typedef in the generator’s output.
Sourcepub fn override_typedef_types<T, U, I>(self, typedefs: I) -> Self
pub fn override_typedef_types<T, U, I>(self, typedefs: I) -> Self
Override the types of typedefs in the generator’s output based on the typedef-type pairs in
typedefs.
Sourcepub fn override_constant_type<T: AsRef<str>, U: AsRef<str>>(
self,
constant: T,
type_: U,
) -> Self
pub fn override_constant_type<T: AsRef<str>, U: AsRef<str>>( self, constant: T, type_: U, ) -> Self
Override the type of constant in the generator’s output.
Sourcepub fn override_constant_types<T, U, I>(self, constants: I) -> Self
pub fn override_constant_types<T, U, I>(self, constants: I) -> Self
Override the types of constants in the generator’s output based on the constant-type pairs in
constants.
Sourcepub fn override_constant_value<T: AsRef<str>, U: AsRef<str>>(
self,
constant: T,
value: U,
) -> Self
pub fn override_constant_value<T: AsRef<str>, U: AsRef<str>>( self, constant: T, value: U, ) -> Self
Override the value of constant in the generator’s output.
Sourcepub fn override_constant_values<T, U, I>(self, constants: I) -> Self
pub fn override_constant_values<T, U, I>(self, constants: I) -> Self
Override the values of constants in the generator’s output based on the constant-value pairs
in constants.
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.