Skip to main content

ExplicitIntTypesCallbacks

Struct ExplicitIntTypesCallbacks 

Source
#[non_exhaustive]
pub struct ExplicitIntTypesCallbacks;
Expand description

Callbacks to specify what type of integer should be used for various C #defined constants.

Implementations§

Source§

impl ExplicitIntTypesCallbacks

Source

pub fn new() -> Self

Create a new callbacks instance to int macro types.

Trait Implementations§

Source§

impl Clone for ExplicitIntTypesCallbacks

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ExplicitIntTypesCallbacks

Source§

impl Debug for ExplicitIntTypesCallbacks

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExplicitIntTypesCallbacks

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ParseCallbacks for ExplicitIntTypesCallbacks

Source§

fn int_macro(&self, name: &str, _value: i64) -> Option<IntKind>

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.
Source§

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

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

fn generated_name_override(&self, _item_info: ItemInfo<'_>) -> Option<String>

This function will run for every extern variable and function. The returned value determines the name visible in the bindings.
This function will run for every extern variable and function. The returned value determines the link name in the bindings.
Source§

fn modify_macro(&self, _name: &str, _tokens: &mut Vec<Token>)

Modify the contents of a macro
Source§

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

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.
Source§

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

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. Read more
Source§

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

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

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

Allows to rename an enum variant, replacing _original_variant_name.
Source§

fn item_name(&self, _item_info: ItemInfo<'_>) -> Option<String>

Allows to rename an item, replacing _item_info.name.
Source§

fn header_file(&self, _filename: &str)

This will be called on every header filename passed to Builder::header.
Source§

fn include_file(&self, _filename: &str)

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

fn read_env_var(&self, _key: &str)

This will be called every time bindgen reads an environment variable whether it has any content or not.
Source§

fn blocklisted_type_implements_trait( &self, _name: &str, _derive_trait: DeriveTrait, ) -> Option<CanDerive>

This will be called to determine whether a particular blocklisted type implements a trait or not. This will be used to implement traits on other types containing the blocklisted type. Read more
Source§

fn add_derives(&self, _info: &DeriveInfo<'_>) -> Vec<String>

Provide a list of custom derive attributes. Read more
Source§

fn add_attributes(&self, _info: &AttributeInfo<'_>) -> Vec<String>

Provide a list of custom attributes. Read more
Source§

fn field_attributes(&self, _info: &FieldAttributeInfo<'_>) -> Vec<String>

Provide a list of custom attributes for struct/union fields. Read more
Source§

fn process_comment(&self, _comment: &str) -> Option<String>

Process a source code comment.
Source§

fn field_visibility(&self, _info: FieldInfo<'_>) -> Option<FieldVisibilityKind>

Potentially override the visibility of a composite type field. Read more
Source§

fn field_name(&self, _info: FieldInfo<'_>) -> Option<String>

Allows to rename a struct or union field, replacing _info.field_name.
Source§

fn new_item_found( &self, _id: DiscoveredItemId, _item: DiscoveredItem, _source_location: Option<&SourceLocation>, )

This will get called everytime an item (currently struct, union, and alias) is found with some information about it

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.