At this point it's clear that we can't use schematic to describe the structure of exported types. It was originally created with the expectation that it could work to describe both the data generated by Serde and types exported by cs-bindgen, but over time it's become more clear that those two use cases are different enough to warrant having completely different setups. In #58 I introduced a custom Repr enum for describing the representation of exported values, which replaced most of the usages of Schema in cs-bindgen. At this point, the only place Schema is used is to describe exported value types.
To fully remove the dependency on schematic, we need to do the following:
Replace the usage of Schema for value types. This will require that we create something like StructRepr and EnumRepr types to describe the structure of exported types. Each field can in turn be a Repr, so we don't need to fully traverse the type the way that schematic.
Replace schematic::TypeName with our own TypeName type. It doesn't need to support generics the way that schematic's does, which means we can also replace Named::type_name with a TYPE_NAME associated constant.
At this point it's clear that we can't use schematic to describe the structure of exported types. It was originally created with the expectation that it could work to describe both the data generated by Serde and types exported by cs-bindgen, but over time it's become more clear that those two use cases are different enough to warrant having completely different setups. In #58 I introduced a custom
Repr
enum for describing the representation of exported values, which replaced most of the usages ofSchema
in cs-bindgen. At this point, the only placeSchema
is used is to describe exported value types.To fully remove the dependency on schematic, we need to do the following:
Schema
for value types. This will require that we create something likeStructRepr
andEnumRepr
types to describe the structure of exported types. Each field can in turn be aRepr
, so we don't need to fully traverse the type the way that schematic.schematic::TypeName
with our ownTypeName
type. It doesn't need to support generics the way that schematic's does, which means we can also replaceNamed::type_name
with aTYPE_NAME
associated constant.