4 ms·
Do not write the bindings manually. Just use the amazing uniffi-rs library from Mozilla. https://github.com/mozilla/uniffi-rs https://github.com/mozilla/uniffi
by lukax 1y ago
Do not write the bindings manually. Just use the amazing uniffi-rs library from Mozilla.
https://github.com/mozilla/uniffi-rs https://github.com/mozilla/uniffi-rs
You can generate bindings for multiple languages. It supports error handling on both sides and latest versions also support native async integration.
I've used it to reuse the same Rust engine in iOS and Android apps and write native UI.
https://github.com/koofr/vault https://github.com/koofr/vault
- cadamsdotcom 1y agoThanks! Anywhere you hit issues?
- lukax 1y agoNot really. But I didn't use async (was not supported yet when I started using it). Bindings were easy, everything else (building, linking,...) was a bit pain to setup because there no good examples.
- 4hg4ufxhy 1y agoThe bindings are inefficient doing excessive cloning. But if performance is not a concern then its fine.
- no_wizard 1y agoCouldn’t you manually edit after generating so you could thereby optimize the code as needed?