-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ Feature Request ] Resolve trait associated types #106
Comments
I am also interested in this. Does anyone have an idea of how feasible it is? e.g. I have various functions like
which currently generate headers like
|
cbindgen doesn't hook into the rust compiler so it doesn't seem particularly easy to do it in the general case. |
I require this feature badly. After having written most of this library for generating FFI out of existing rust structures I come here to find that generating C bindings would prove more of a challenge. My problem is twofold: 1. Do you find this approach feasible and do you think that 2. be integrated with |
Please assign me to this issue. I have already almost finished the implementation of the solution. Thank you |
I've written some derive code that generates the equivalent C api structs for me. After running cargo expand the structs look like
Unfortunately there is currently no way for me to automatically generate the equivalent C header bindings as no bindings generator can currently handle resolving what ::Output means. Currently I've worked around this by generating type names for each associated type but it feels ugly to do it that way, and my generated C headers get a lot of extra typedefs.
It would be nice if the bindings generator could resolve associated types like it does regular types.
If you have an idea of where to start I don't mind taking a stab at it
The text was updated successfully, but these errors were encountered: