rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Add support for custom attributes

Open mkroening opened this issue 1 year ago • 0 comments

This adds support for custom attributes:

  • ParseCallbacks::add_attributes(&self, info: &AttributeInfo<'_>) -> Vec<TokenStream>
  • --with-attribute-custom <CUSTOM>
  • --with-attribute-custom-struct <CUSTOM>
  • --with-attribute-custom-enum <CUSTOM>
  • --with-attribute-custom-union <CUSTOM>

The implementation is very similar to the custom derives functionality. One thing I am not sure about is returning Vec<TokenStream> instead of Vec<String>, but that seemed natural to me.

Fixes https://github.com/rust-lang/rust-bindgen/issues/2520

mkroening avatar Jul 08 '24 14:07 mkroening