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

Add support for different item types #14

Closed randomPoison closed 4 years ago

randomPoison commented 4 years ago

Update the code generation logic to support other item types in addition to functions. Currently only functions are fully supported for #[cs_bindgen], but there is stubbed-out support for structs in place that will be fleshed out more in a subsequent PR.

In addition, I've added better error handling support in cs-bindgen-cli. It will now gracefully handle any issues while loading the declarations from the wasm module and print a more descriptive error message instead of panicking. I've opted to use the snafu crate for error handling, since it seemed like the most straightforward option that I could find in five minutes.