Improving function pointer/callbacks readability #57
Replies: 1 comment 2 replies
-
IIRC the issue is that function pointers are anonymous, which means you could only ever name them once on a type level. For example, you can impl In addition, implementing The only way around that were user-definable custom types, how the current callback / delegate system works. Type aliases I think best way forward is do something with the |
Beta Was this translation helpful? Give feedback.
-
Currently, function pointers in generated bindings are named based on their argument types, and are given default argument names (x0, x1, etc). In order to enhance readability, I'd like to add the ability to specify a custom name for a function pointer (or use the name of the rust type alias), and also provide some metadata on names to give the arguments. This would make it far easier to visually parse the declarations in bindings files.
I've played around with a few ways to achieve this, it seems to be that adding an additional macro may be the best approach (e.g.
ffi_callback
), but would be interested to hear other thoughts, as well as any other points that should be considered when implementing this feature.Beta Was this translation helpful? Give feedback.
All reactions