uniffi-rs
uniffi-rs copied to clipboard
Allow calling from more than one language at the same time
I'd like to be able to initialize and use Rust from multiple languages at the same time [in the same process].
Example use case:
From React-Native Javascript, call into Rust which then calls out to Kotlin.
The C ABI should remain the same for the foreign language, so calling in to Rust would need no modifications.
I think the only thing to need to change would be adding an index parameter to callback registration and UniffiRustFutureContinuationCallback, so that the callback knows which vtable to call into. This would require work on both foreign and Rust sides.
I don't think this would be on Mozilla's roadmap, so am quite happy to do the work.
Is this a feature you'd be willing to land?