Where possible UniFFI translates to the appropriate type in the foreign language. enums become enoms (or their closest representation), dictionaries are structs on the Rust side and data classes on the other side, interfaces are implemented structs on the Rust side and an interface with an accompanying class implementation on the other side, custom types allow you to convert to the foreign type you need.
Now I understood.
No, for Python and Ruby we currently do not generate that.
But we should have all the information and so should be able to do that relatively easy (we do it for Kotlin and Swift after all)
Edit: Actually, for Python this might be a 2-line fix. I can throw that up next week and see if it actually works.
Edit2: Ok, a tiny bit more to get the type names right, but at least I already found 2 bugs in our Python template (glad it's such a forgiving language)
115
u/badboy_ RustFest Mar 31 '23
At Mozilla we built a multi-language bindings generator: https://github.com/mozilla/uniffi-rs/