android ffi (aries rust sdk) project meeting on Friday 19 June 2023
Aries VCX code walkthrough.
First we had an introduction to some parts of Aries VCX, which consist of interfaces and implementations.
George spoke of them as different engines (implementations) that match the specs (interface trait) of the car vcx.
This way we can swap the engine (implementation) as needed, without modifying other parts of the car (aries-vcx codebase).
Tip: Have breakpoints integrated in editor. Too see state of memory at points in code .
- George Mulhearn
UniFFI bindings for Rust code
George Mulhearn gave a nice presentation on UniFFI. First there was an introduction to what it is, then a small, short demo of porting a simple boolean function.
Thanks for demo!
Learnings:
UniFFI is made by Mozilla
You can write "UDL" file.
- That describes rust crate that you want to expose.
- This helps generate bindings for Kotlin, Swift etc, that wrap calls to FFI bindings in the C layer.
Demo notes:
- They (Mozilla?) have a book guide about UDL.
- Use that to define UDL file for a project/library.
-
Then add macro of UniFFI above func you want to export(expose?).
-
Don't forget to use cargo-ndk to build for arm/jni architecture specifically (when targetting Android)
-
UniFFI doesn't support wrapping over async func, just yet. So we need to wrap async funcs into sync (blocking) code then export.