inline-rust
inline-rust copied to clipboard
Support function pointer types
There is some trickiness around FunPtr and "dynamic" foreign imports.
See the docs on FunPtr for more information.
These are now supported, but not automatically. Utilities are provided for automatically marshaling into and out of FunPtr. That said, it is on the user to free the FunPtr (in general, we have no way of knowing when there are no references to FunPtr on the Rust side).
Before closing this issue, I have once more idea: let Rust take ownership of the function pointer! Here is a sketch of what the types might be on the Rust side. This doesn't mean nuking our existing function pointer approach, but it is a compelling alternative context.