I know this is not a very common situation in Rust, but what is the idiomatic way to describe a pointer pointing to memory of unknown type and size?
*const u8 or
*const ()? Personally, I prefer keeping the
std::os::raw types (like
c_void) as close to the FFI boundaries as possible and not cluttering my library code or exposing these types in my library’s interface.
Since in this specific case I know that these pointers are actually function pointers of unknown type, maybe I should create a type alias (e.g.
type FnPointer = *const c_void)? If so, what type to create the alias for? What do you guys think?