-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] Restore public visibility of previously-public fields #7700
Conversation
I think they became invisible in this P.R. #7518 |
Yeah, that looks right. Unfortunately we were using these public fields. |
Can you talk more about your use case? maybe we can provide getter/setter methods - it will likely have to be unsafe though |
Why would it have to be unsafe? We compute hashes of some classes of our flatbuffer serialized objects. Our objects also include modification timestamps. But we also wish to ignore the timestamp when calculating the integrity hash, we force the modification field to zero in the object before hashing it. |
Because tables are assumed to be verified on construction, arbitrary editing can invalidate that (e.g. by modifying a relative pointer) |
Ideally, we'd expose a safe mutation API (assuming the timestamp is in the table schema), but absent this you'd need to modify the slice yourself and that has to be unsafe given the pre-verified assumption |
I've changed the PR to expose getters for the buf and loc fields; I don't think we need setters. |
…7700) * Restore public visibility of previously-public fields * code review feedback
…7700) * Restore public visibility of previously-public fields * code review feedback
…7700) * Restore public visibility of previously-public fields * code review feedback
We relied on these two fields being public in the Table interface and this change restores their visibility.