-
Notifications
You must be signed in to change notification settings - Fork 14
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
Seamless serialization of existing Rust structs #182
Comments
We could probably implement this, but I am very hesitant to implement custom attributes if we can avoid it. Depending on your performance and organizational requirements, some of these work-arounds might suit your particular needs:
At my work we use a combination of these approaches, though we try to use the first one as much as possible. If these work-arounds does not work for your use-case, could you expand a bit more upon what you need and why? I'd love to support as many use-cases as possible, but I don't think I will add features without understanding the situations where those features are needed. |
Big challenge with Planus (and Flatbuffers in general) is that generated types do not contain documentation and do not allow us to have more fine-grained type. For instance, above On Flatbuffers level right now it is just With Planus generated data structures end up being something like |
@nazar-pc We support docstrings in planus, which mitigates the issue you mentioned a bit. However you are right that we do not allow the level of documentation you would get otherwise. |
Regarding the heap allocations, I would suggest that you use a |
There is no |
We should really get around to making a new release... On the current main branch there is a builder 😊 |
Having an existing Rust struct which is also represented in the flatbuffers schema and thus in the autogenerated code.., is there any derive or traits we can implement in our struct so it can seamlessly serialize it into the builder, rather than having to manually convert from our struct to the one created by the autogenerated code?
Imagine a simple struct like:
Which has an analogous flatbuffers table which leads to the autogenerated code:
Is there any derive or trait we could implement to serialize our
DominantSpeakerNotification
into the builder?The text was updated successfully, but these errors were encountered: