This PR makes two major changes to how we handle marshaling data across the language boundary and how we generate the C# bindings:
It introduces a trait-based system for passing values to-and-from C#.
It introduces the schematic crate for providing robust type schemas that can be leveraged by the C# code generator to support user-defined types in a uniform manner.
ABI Conversions
ABI conversions are now handled by the FromAbi and IntoAbi traits. These are implemented for any type that can be passed to or received from C#. This also drastically simplifies code generation, since all generated bindings now uniformly defer to the FromAbi/IntoAbi implementation for a given value.
Type Schemas
In order to support more robust bindings on the C# side, we're now using the schematic crate to generate type schemas for any user-defined types exposed. This give C# full type information, so that it can perform the correct type conversions. This isn't being used fully now, but paves the way for initial support for returning custom types from exported functions.
Closes #21, Closes #13
This PR makes two major changes to how we handle marshaling data across the language boundary and how we generate the C# bindings:
ABI Conversions
ABI conversions are now handled by the
FromAbi
andIntoAbi
traits. These are implemented for any type that can be passed to or received from C#. This also drastically simplifies code generation, since all generated bindings now uniformly defer to theFromAbi
/IntoAbi
implementation for a given value.Type Schemas
In order to support more robust bindings on the C# side, we're now using the schematic crate to generate type schemas for any user-defined types exposed. This give C# full type information, so that it can perform the correct type conversions. This isn't being used fully now, but paves the way for initial support for returning custom types from exported functions.