[][src]Struct cbindgen::Config

pub struct Config {
    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 using_namespaces: Option<Vec<String>>,
    pub braces: Braces,
    pub line_length: usize,
    pub tab_width: usize,
    pub language: Language,
    pub cpp_compat: bool,
    pub style: Style,
    pub parse: ParseConfig,
    pub export: ExportConfig,
    pub macro_expansion: MacroExpansionConfig,
    pub function: FunctionConfig,
    pub structure: StructConfig,
    pub enumeration: EnumConfig,
    pub constant: ConstantConfig,
    pub defines: HashMap<String, String>,
    pub documentation: bool,
    pub documentation_style: DocumentationStyle,
}

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++"

using_namespaces: Option<Vec<String>>

An optional list of namespaces to declare as using. 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

cpp_compat: bool

Include preprocessor defines in C bindings to ensure C++ compatibility

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

macro_expansion: MacroExpansionConfig

The configuration options for macros.

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

documentation_style: DocumentationStyle

How documentation comments should be styled.

Methods

impl Config[src]

pub fn from_file<P: AsRef<StdPath>>(file_name: P) -> Result<Config, String>[src]

pub fn from_root_or_default<P: AsRef<StdPath>>(root: P) -> Config[src]

Trait Implementations

impl Clone for Config[src]

impl Default for Config[src]

impl Debug for Config[src]

impl<'de> Deserialize<'de> for Config where
    Config: Default
[src]

Auto Trait Implementations

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

impl RefUnwindSafe for Config

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]