Ideally, the Nomicon should be enough to teach you everything you need to know about authoring an FFI API in Rust, without you needing to learn C to the level of knowing the idioms. Things like void *userdata, or having the return value be the error code with the 'real' return in an out-parameter, or when collections should be null-terminated instead of having a length parameter, or having a deallocation function and naming it _free. Right now the FFI chapter tells you how to link to another library, but not really how to write your own.
Ideally, the Nomicon should be enough to teach you everything you need to know about authoring an FFI API in Rust, without you needing to learn C to the level of knowing the idioms. Things like
void *userdata
, or having the return value be the error code with the 'real' return in an out-parameter, or when collections should be null-terminated instead of having a length parameter, or having a deallocation function and naming it_free
. Right now the FFI chapter tells you how to link to another library, but not really how to write your own.