Trait bindgen::callbacks::ParseCallbacks[][src]

pub trait ParseCallbacks: Debug + UnwindSafe {
    fn will_parse_macro(&self, _name: &str) -> MacroParsingBehavior { ... }
fn int_macro(&self, _name: &str, _value: i64) -> Option<IntKind> { ... }
fn str_macro(&self, _name: &str, _value: &[u8]) { ... }
fn func_macro(&self, _name: &str, _value: &[&[u8]]) { ... }
fn enum_variant_behavior(
        &self,
        _enum_name: Option<&str>,
        _original_variant_name: &str,
        _variant_value: EnumVariantValue
    ) -> Option<EnumVariantCustomBehavior> { ... }
fn enum_variant_name(
        &self,
        _enum_name: Option<&str>,
        _original_variant_name: &str,
        _variant_value: EnumVariantValue
    ) -> Option<String> { ... }
fn item_name(&self, _original_item_name: &str) -> Option<String> { ... }
fn include_file(&self, _filename: &str) { ... } }

A trait to allow configuring different kinds of types in different situations.

Provided methods

fn will_parse_macro(&self, _name: &str) -> MacroParsingBehavior[src]

This function will be run on every macro that is identified.

fn int_macro(&self, _name: &str, _value: i64) -> Option<IntKind>[src]

The integer kind an integer macro should have, given a name and the value of that macro, or None if you want the default to be chosen.

fn str_macro(&self, _name: &str, _value: &[u8])[src]

This will be run on every string macro. The callback cannot influence the further treatment of the macro, but may use the value to generate additional code or configuration.

fn func_macro(&self, _name: &str, _value: &[&[u8]])[src]

This will be run on every function-like macro. The callback cannot influence the further treatment of the macro, but may use the value to generate additional code or configuration.

The first parameter represents the name and argument list (including the parentheses) of the function-like macro. The second parameter represents the expansion of the macro as a sequence of tokens.

fn enum_variant_behavior(
    &self,
    _enum_name: Option<&str>,
    _original_variant_name: &str,
    _variant_value: EnumVariantValue
) -> Option<EnumVariantCustomBehavior>
[src]

This function should return whether, given an enum variant name, and value, this enum variant will forcibly be a constant.

fn enum_variant_name(
    &self,
    _enum_name: Option<&str>,
    _original_variant_name: &str,
    _variant_value: EnumVariantValue
) -> Option<String>
[src]

Allows to rename an enum variant, replacing _original_variant_name.

fn item_name(&self, _original_item_name: &str) -> Option<String>[src]

Allows to rename an item, replacing _original_item_name.

fn include_file(&self, _filename: &str)[src]

This will be called on every file inclusion, with the full path of the included file.

Loading content...

Implementors

impl ParseCallbacks for CargoCallbacks[src]

Loading content...