-
-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[meta] Getter interface for primitive opaque types #1403
base: master
Are you sure you want to change the base?
Conversation
73c85da
to
cfc9618
Compare
cfc9618
to
74b273f
Compare
How does this work when you have a type with multiple members? Wouldn't it be possible to implement this with the existing |
This PR only deals with reading an opaque as a primitive type. PR #1405 is dedicated to collection types and introduces In the example above, the opaque is implemented as struct, perhaps the example is contrived. But note that in the example, the Background: https://discord.com/channels/633826290415435777/1295740423293108298 where you considered this as missing in the API. In essence, this PR only provides the symmetric side of the The idea here is that if an opaque, of whatever
I consider As a summary, this just helps making the API symmetrical. |
Never mind, I see that this is just for primitive types. Makes sense now. Let me think for a bit on the interface (whether I prefer this or a single untyped |
Here is my full analysis, for your review: option 1: single, untyped
|
74b273f
to
fad78ec
Compare
This PR adds support for reading opaque types that map to primitives without having to invoke a serializer that may output an unwanted type.
The opaque interface now has "get" callbacks that allow to define a function that will retrieve the value from the opaque.
Opaques are now transparent 😅 to cursors.