Open cloneable opened 1 month ago
Probably not to ParseCallback
, since it's not something that needs done during parsing? But yeah, it seems generalizing the derive API to also support other attributes seems reasonable.
So, apparently, there's already support for this since 0.70.0, according to the change log: https://github.com/rust-lang/rust-bindgen/blob/07bbd04ea5f386aa3b83e792548127e2a2e33c43/CHANGELOG.md#L240 And the callback method can be found in the main branch: https://github.com/rust-lang/rust-bindgen/blob/07bbd04ea5f386aa3b83e792548127e2a2e33c43/bindgen/callbacks.rs#L132-L138 But is not part of tagged version 0.70.0 and .1. That's why I couldn't find it.
Ok, I guess I will just wait for 0.71 then.
Hi! I would like to ask if we can add a method to
ParseCallback
that emits custom attributes? I have a several larger enums generated by bindgen and would like to usestrum::EnumString
to look up variants by name, but to make it efficient I also want to add#[strum(use_phf)]
. The former can be easily done, but the latter doesn't seem possible with bindgen.Is this something you'd be open to adding to
ParseCallback
? I could imagine this to be useful for serde, too.