You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 15, 2022. It is now read-only.
Right now describing a type always results in a unified representation of the type, e.g. when using the built-in functionality you'll always get a Schema value. Being able to unify all types under one schema representation is necessary in order to fully represent a type tree, however it's also useful in some cases to be able to directly get the specialized representation of the type being described.
It would be helpful to add specialized alternatives to the Describe trait that can return more direct information in contexts where the type of type is known, e.g. DescribeStruct, DescribeEnum, etc. We could provide a blanket impl of Describe for these types for consistency. These traits would also be useful as trait bounds, since it would allow users to write generic code that only accepts a type that can be described as a struct (for example).
It's not clear how specific we should get with these specialized traits. DescribeStruct and DescribeEnum seem reasonable, are there any others that make sense? Would we want something like DescribeSequence or DescribeMap? DescribeTuple? DescribePrimitive?