Join Nostr
2025-03-29 21:07:35 UTC

gudenau on Nostr: I'm going to guess that if I have a FFI function with the C prototype of `Status ...

I'm going to guess that if I have a FFI function with the C prototype of `Status list(Handle handle, Element* elements, size_t* count)` calling it as a Rust prototype of `unsafe extern "C" fn list(handle: Handle, elements: *mut Option<Element>, count: *mut usize) -> Status` is incorrect? I have a C impl of that that is setting 4 elements of a Rust allocated `Vec<Option<Element>>` and the second half are `None` for some reason.

I'm not sure what I am doing wrong.