randomPoison / cs-bindgen

Experiment in using Rust to build a library that can be loaded by Unity across multiple platforms
4 stars 0 forks source link

Support marshaling structs by value #43

Closed randomPoison closed 4 years ago

randomPoison commented 4 years ago

Support for marshaling Rust types by value was added in #40 to enable passing data-carrying enums in a meaningful way. This PR extends that functionality to structs as well, with structs that derive Copy being marshaled by value by default. In doing so, I was also able to simplify and generalize a lot of the logic that was previously specific to generating code for data-carrying enums.