In nix, we provide Rusty interfaces to unix system functions. This includes functions that deal with
iovecs. The order of pointer / length fields is the same for
iovec as it is for
&[u8], so I’ve been considering wrapping
writev, and other functions to accept
&[&[u8]] instead of a struct. There’s an issue with some more detail.
Is this a terrible idea?
#[repr(C)] with those field types in that order. How likely is this representation to change? Can I do anything to feel safer about this, either in C or at build time for dependent projects?