So far, the best example I've seen is from bindgen:
But I was hoping for something simpler and that didn't require using bindgen. I only have one or two of these. I could of course do everything bindgen's doing, but I'd like to fully understand the tradeoffs involved.
If I am correct, maybe only write a [WORD; 1] for structs and only use its reference or raw pointer other than creating an instance of itself? OS-oriented adaptions like winapi somehow do this in practice.
Yes, it seems there's no better accepted option right now. I see various projects have written tooling around this but given how common this is and relevant to FFI, it would be nice if rust had a native wrapper for it.