-
Notifications
You must be signed in to change notification settings - Fork 523
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
[Rust] proposal: add a new encoder setter method for fixed length array copying from slice ref #1021
Comments
Hi Iv created a new pr #1026 to address this issue. Please tell me what you think. |
@mward Can you have a look? Thanks. |
I'll take a look. Thanks |
@mward Ok, will try to compact the implementation. |
@mward just updated the implementation:
Could you help review it ? |
I'll check it out |
Hi @mward I think we should not introduce breaking changes in generated code say for primitive array setters. Maybe you can choose a new name for slice setter, like the iter variant do. |
@mward I just leave some comments on your pr, feel free to accept or reject them. As en is not my native language, just ignore the words or sentences may look impolite/rude to you. |
changing function param from array to slice doesn't break anything, consumer of library won't need to make any changes |
An array ref is not the safe thing as a slice ref. An array ref has length info built into its type while a slice ref doest. |
True, I meant signature wise |
It's very common to serialize an obj as SBE, when obj having a field of String type (or similar) while SBE defining it as fixed length primitive array.
When encoding a field of fixed length primitive array type, one must:
It may be more convenient to generate a new method copy from directly slice ref.
For example, there exists a field named "account" of char[16].
Currently it generates a method called "account" with parameter of type
&[u8; 16]
.Following method is proposed to be generated as well:
The text was updated successfully, but these errors were encountered: