I used to play with writing libraries in Rust, and it was not difficult. Now, however, I'm stuck: I'm trying to write a binding for librsync , and some of its functions expect you to pass an open file descriptor (a FILE* in C).
For primitive types, there is an easy way to pass them to C (the same for pointers to primitive types). And, more clearly, I know that the libc box implements fopen , which in turn gives me mut FILE* (which will eventually complete the task). However, I was wondering if there is anything in the Rust standard library that gives me FILE* to switch to librsync - maybe something analogous with std::ffi::CString .
source share