-
Notifications
You must be signed in to change notification settings - Fork 29
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
Serde support? #138
Comments
To clarify, you are wanting the ability to serialize and deserialize predicates? In theory, we could support this on some of the predicates, so long as they don't take a closure, etc but how would you plan to dispatch between the different predicates since a trait is being used. Would it be expected that the predicates project provides an enum encompassing built-in predicates (which seems like a dead end) or would users do that? |
Yes, exactly. Basically, this would be similar to JsonLogic.
To be honest, I don't have any idea about any of this. I just had a cursory look at I thought it would be possible to just generate a serializable data structure, similar to JsonLogic, which can be deserialized back to a predicate.
I've never used those crates, but maybe closures can be serialized via something like typetag or serde_traitobject. For example, the creator of |
First, I'll be upfront that this is not a priority for maintainers and this will likely only move forward by external contributors. Second, some possible paths forward for this
|
Thanks for the suggestions, @epage! For my current project I decided to just hard code some predicates, but I might give this a try in the future. Just to be clear: I never expected that this will be implemented quickly (or at all), but I thought it would be a useful addition, and that an open issue is a good way to see if other people are interested in this as well (via comments and other reactions). |
Hi,
(De-)serialization via
serde
would be a great addition topredicates
.This would be useful when a UI has filters which should be stored (so users don't have to setup the filters every time they open the application).
Or to send predicates between a server and a client.
The text was updated successfully, but these errors were encountered: