I've started to revise my FFI guide and was wondering if I could get some feedback. I don't want to clobber the existing guide, so I've uploaded it to a S3 bucket.
This is written from the perspective of someone writing a GUI program (a basic REST client) in C++ and Qt, but using Rust for all the business logic.
So far it's touched on quite a few topics including:
- Setting up the build system (
cmake
) and integratingcargo
into it - Creating the basic business logic for sending HTTP requests (using
reqwest
) and converting them into my own simplifiedRequest
andResponse
types - Writing FFI bindings for that business logic
- Create an idiomatic (I hope!) C++ wrapper around the Rust
Request
andResponse
types- How to hook up the destructors for the underlying Rust types into the C++ class destructors
- Passing strings and arrays between the two languages
- Structuring an application so you separate the UI from the business logic to prevent code monsters (ongoing)
Any feedback is welcome
Some useful links: