|
|
|
|
|
by bengl3rt
748 days ago
|
|
I only read the paper (and the code in the paper) but not the complete source code, so maybe this would become clearer if I had, but... Does Rust fundamentally guarantee that if you make a struct, its fields will lay out in memory in the order that you defined them? Can it be used to interact with APIs (really ABIs) who expect a C struct (or pointer to one)? I think my main frustration with stuff like Go and Swift in this case is that their structs are not binary-compatible with C structs in this way because they rearrange things to be better aligned/packed/whatever. |
|
https://doc.rust-lang.org/reference/type-layout.html#the-c-r...