SpacetimeDB
SpacetimeDB copied to clipboard
Add `AlgebraicTypeDef` and `AlgebraicTypeUse`
We want to have methods that operate on AlgebraicTypes that have been validated as type definitions / type uses for client codegen. Currently the relevant methods (AlgebraicType::is_valid_for_client_type_def / AlgebraicType::is_valid_for_client_type_use) return bool, but they should be upgraded / have new methods added that return enums AlgebraicTypeDef / AlgebraicTypeUse storing precisely the information we want. (Parse, don't validate).
That is, UNLESS we want a deeper reworking of the type system to actually bake notions of separate "structural" and "nominal" types into the type system, or some other approach, cc @cloutiertyler. But this approach is easy to implement and will suffice for now.