Does interoptopus work with generics #112
Replies: 3 comments
-
This folder here basically shows what's possible. Actual functions can't be generic (which is a fundamental limitation of any C-like FFI invocation). Types can be generic, if they're specialized for a specific function. Have a look at the |
Beta Was this translation helpful? Give feedback.
-
Hi thanks for the info, take for example this snippet of code from that lib
I'm not that well versed with rust but from my understanding |
Beta Was this translation helpful? Give feedback.
-
Unfortunately not, and this can never work as a fundamental limitation of cross-language interop. Simply speaking, supporting any When you author a function So long story short, that means if you write such a generic |
Beta Was this translation helpful? Give feedback.
-
Hi I'm trying to use interoptopus for this library https://github.com/lukaslueg/railroad which makes heavy use of generics.
I've done some research and found that Rust doesn't allow generic functions to be exported.
#[no_mangle]
is not allowed on generic functions.Is it possible to use
interoptopus
on generic functions using some workarounds.My end goal is to use that rust library in C#/.NET on windows.
Beta Was this translation helpful? Give feedback.
All reactions