Struct bindgen::Builder
[−]
[src]
pub struct Builder<'a> { /* fields omitted */ }
A builder to generate bindings.
Methods
impl<'a> Builder<'a>
[src]
fn new<T: Into<String>>(header: T) -> Builder<'a>
Returns a new builder for the C header to parse.
fn match_pat<T: Into<String>>(&mut self, arg: T) -> &mut Self
Add a pattern to filter which file to generate a binding for.
fn clang_arg<T: Into<String>>(&mut self, arg: T) -> &mut Self
Add a clang CLI argument.
fn link<T: Into<String>>(&mut self,
library: T,
link_type: LinkType)
-> &mut Self
library: T,
link_type: LinkType)
-> &mut Self
Add a library to link.
fn forbid_unknown_types(&mut self) -> &mut Self
Force bindgen to exit if a type is not recognized.
fn builtins(&mut self) -> &mut Self
Control if we should use the c builtins like __va_list
.
fn derive_debug(&mut self, derive_debug: bool) -> &mut Self
Control if the generated structs will derive Debug.
fn rust_enums(&mut self, value: bool) -> &mut Self
Control if bindgen should convert the C enums to rust enums or rust constants.
fn log(&mut self, logger: &'a Logger) -> &mut Self
Set the logger to use.
fn override_enum_ty<T: Into<String>>(&mut self, ty: T) -> &mut Self
Overrides the type used to represent a C enum.
fn remove_prefix<T: Into<String>>(&mut self, ty: T) -> &mut Self
Set the prefix to remove from all the symbols, like libfoo_
.
fn emit_ast(&mut self, value: bool) -> &mut Self
Controls if bindgen should also print the parsed AST (for debug).
fn use_core(&mut self, value: bool) -> &mut Self
Defines if we should use std
or core
for Option
and such.
fn ctypes_prefix<T: Into<Vec<String>>>(&mut self, prefix: T) -> &mut Self
Sets the prefix to use for c_void and others.
fn dont_convert_floats(&mut self) -> &mut Self
Defines if we should convert float and double to f32 and f64.
The format is not defined, but is the same as in rust in all the supported platforms.
fn convert_macros(&mut self, value: bool) -> &mut Self
Turn macros definitions into const definitions, when possible
fn macro_int_types<T: Into<String>, I: Iterator<Item=T>>(&mut self,
types: I)
-> &mut Self
types: I)
-> &mut Self
When converting macros, convert integers that would fit in a u8
,
u16
, u32
, u64
, i8
, i16
, i32
, i64
to the corresponding
named C type the supplied list.
The Iterator
must return exactly 8 items.
fn generate(&self) -> Result<Bindings, ()>
Generate the binding using the options previously set.
Trait Implementations
impl<'a> Debug for Builder<'a>
[src]
impl<'a> Clone for Builder<'a>
[src]
fn clone(&self) -> Builder<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more