Can an embedded library invoked via FFI read an iOS app's sandboxed filesystem?

227 Views Asked by At

I'm toying with the notion of building an iOS app powered by a Rust library. I want this app to use the Files App for storing plain text files that my app will manipulate, but I don't know if my Rust library can read the files stored there directly or if they need to be read into memory first by my Swift code and passed in as arguments when invoking my Rust library through FFI.

I'm still learning both Swift & Rust, so I haven't gotten a workable prototype built yet (thus no code to share), but I want my Rust library to be able to

  1. Read directory and file contents (presumably the sandboxed Documents directory available to my iOS app)
  2. Write updates to the same files.

Is this possible? If so, how might it look?

0

There are 0 best solutions below