rust-lang / rust-bindgen

Automatically generates Rust FFI bindings to C (and some C++) libraries.
https://rust-lang.github.io/rust-bindgen/
BSD 3-Clause "New" or "Revised" License
4.25k stars 682 forks source link

Add `FieldInfo::field_type_name` #2863

Open workingjubilee opened 1 week ago

workingjubilee commented 1 week ago

In my case, I want to make a field private and wrap it behind an accessor function that makes the field unsafe to access. I need the field's type in order to make this decision correctly. In some cases a type name is not available and I am fine with that.

pvdrz commented 1 week ago

Is there any chance you could document this in the changelog? it looks good to me otherwise