You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just recently tried to update from the Rust flatbuffer Version 2.1.2 to the newest 22.10.26.
However, one change kind of broke my entire design:
In 2.1.2 the buf: &'a [u8] field inside the Table struct was public.
So you could easily create a real copy of your Flatbuffer-Object, just by cloning the inner table:
Here I "encode" a generated flatbuffer object, so I have a Vec<u8> or in this case Bytes Object,
which I can freely move around (as it lives on the heap), and reinterpret as my flatbuffer type with
root_unchecked::<MyType>( bytes )
Which is kind of nice, as it allows me to move the flatbuffer objects around and pass copies of it to functions pretty easy.
However - in 22.10.26 this is not possible anymore, and I am wondering why, because I really miss the feature of getting access to the underlying buffer object.
Am I missing an obvious way of how you should handle these objects ?
Would it be possible to re-add the old interface ?
(Maybe the field does not need to be public, but instead a getter-function to the inner buffer ?)
I would happily create a pull request, if this is desired.
Please let me know, and keep up your amazing work with this project.
Thank you !
The text was updated successfully, but these errors were encountered:
Nice - this should solve it :).
Out of curiosity - do you have any Idea when this will be released ?
In https://crates.io/crates/flatbuffers the Version is still at 22.10.26 - the commit that fixes it comes after that.
Hello,
I just recently tried to update from the Rust flatbuffer Version 2.1.2 to the newest 22.10.26.
However, one change kind of broke my entire design:
In 2.1.2 the
buf: &'a [u8]
field inside theTable
struct was public.So you could easily create a real copy of your Flatbuffer-Object, just by cloning the inner table:
Here I "encode" a generated flatbuffer object, so I have a
Vec<u8>
or in this caseBytes
Object,which I can freely move around (as it lives on the heap), and reinterpret as my flatbuffer type with
Which is kind of nice, as it allows me to move the flatbuffer objects around and pass copies of it to functions pretty easy.
However - in 22.10.26 this is not possible anymore, and I am wondering why, because I really miss the feature of getting access to the underlying buffer object.
Am I missing an obvious way of how you should handle these objects ?
Would it be possible to re-add the old interface ?
(Maybe the field does not need to be public, but instead a getter-function to the inner buffer ?)
I would happily create a pull request, if this is desired.
Please let me know, and keep up your amazing work with this project.
Thank you !
The text was updated successfully, but these errors were encountered: