Struct cbindgen::Config

source ·
pub struct Config {
Show 23 fields pub header: Option<String>, pub includes: Vec<String>, pub sys_includes: Vec<String>, pub trailer: Option<String>, pub include_guard: Option<String>, pub no_includes: bool, pub autogen_warning: Option<String>, pub include_version: bool, pub namespace: Option<String>, pub namespaces: Option<Vec<String>>, pub braces: Braces, pub line_length: usize, pub tab_width: usize, pub language: Language, pub style: Style, pub parse: ParseConfig, pub export: ExportConfig, pub function: FunctionConfig, pub structure: StructConfig, pub enumeration: EnumConfig, pub constant: ConstantConfig, pub defines: HashMap<String, String>, pub documentation: bool,
}
Expand description

A collection of settings to customize the generated bindings.

Fields

header: Option<String>

Optional text to output at the beginning of the file

includes: Vec<String>

A list of additional includes to put at the beginning of the generated header

sys_includes: Vec<String>

A list of additional system includes to put at the beginning of the generated header

trailer: Option<String>

Optional text to output at the end of the file

include_guard: Option<String>

Optional name to use for an include guard

no_includes: bool

Generates no includes at all. Overrides all other include options

This option is useful when using cbindgen with tools such as python’s cffi which doesn’t understand include directives

autogen_warning: Option<String>

Optional text to output at major sections to deter manual editing

include_version: bool

Include a comment with the version of cbindgen used to generate the file

namespace: Option<String>

An optional name for the root namespace. Only applicable when language=“C++”

namespaces: Option<Vec<String>>

An optional list of namespaces. Only applicable when language=“C++”

braces: Braces

The style to use for braces

line_length: usize

The preferred length of a line, used for auto breaking function arguments

tab_width: usize

The amount of spaces in a tab

language: Language

The language to output bindings for

style: Style

The style to declare structs, enums and unions in for C

parse: ParseConfig

The configuration options for parsing

export: ExportConfig

The configuration options for exporting

function: FunctionConfig

The configuration options for functions

structure: StructConfig

The configuration options for structs

enumeration: EnumConfig

The configuration options for enums

constant: ConstantConfig

The configuration options for constants

defines: HashMap<String, String>

Preprocessor defines to use when generating #ifdef’s for #cfg

documentation: bool

Include doc comments from rust as documentation

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.