Skip to content
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

Implement ExternalValue #96

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Caellian
Copy link
Contributor

This is initial implementation that adds support for abstract-types.

Not well tested (or at all).

I'm mostly creating this to provide an exhaustive example that compiles.

Could close #93 with some additional work, or be used for top level Value trait mentioned in #76.

@Caellian Caellian changed the title Implement ExternalValue (#93) Implement ExternalValue Oct 15, 2024
This is initial implementation. It's not well tested.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@Caellian
Copy link
Contributor Author

Caellian commented Oct 15, 2024

After reading through spec a little. Abstract values are opaque and their members can't be accessed. The added ExternalValue struct allows working in both opaque and non-opaque modes, so I just documented this distinction.

It will default to non-opaque mode if type implements AsValue. Otherwise, an opaque value can always be constructed.

Also, the drop logic I used is something I already tested in another crate with Miri, so it should work.

Oh, and CEL is designed for use with protobuf, so what #81 is doing might be a better fit. I'll probably fork off with these changes into a different crate if I get really invested in this because my use case calls for a lot of things that go against or aren't aligned with the spec.

@Caellian Caellian marked this pull request as draft October 17, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generic abstract type support
1 participant