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
The resulting type is a flatbuffers::Array, that internally just wraps a &[u8].
It would be nice, if these arrays (if they are byte arrays) would automatically implement the AsRef<[u8]> trait from the standard library, to easily integrate in existing interfaces of other crates.
Right now, if you want to use the bytes in some function (e.g. a hash function from another crate), you always have to re-build your slice back from the pointer, which requires an unsafe operation and a copy.
The text was updated successfully, but these errors were encountered:
Hello, this is a suggestion for more ergonomic handling of flatbuffer types.
When I have a byte array in a flatbuffer type, e.g. like this:
The resulting type is a
flatbuffers::Array
, that internally just wraps a&[u8]
.It would be nice, if these arrays (if they are byte arrays) would automatically implement the
AsRef<[u8]>
trait from the standard library, to easily integrate in existing interfaces of other crates.Right now, if you want to use the bytes in some function (e.g. a hash function from another crate), you always have to re-build your slice back from the pointer, which requires an unsafe operation and a copy.
The text was updated successfully, but these errors were encountered: