google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library
https://flatbuffers.dev/
Apache License 2.0
22.56k stars 3.19k forks source link

`get_root_as_*` functions not generated [Rust, 23.5.26, Linux] #8235

Open toumorokoshi opened 5 months ago

toumorokoshi commented 5 months ago

Thanks for all the work on flatbuffers!

I'm trying to use it for a hobby project of mine, and my generated code doesn't have the get_root_as_* structs that seem to be implied from the example to convert a buffer back to a struct: https://flatbuffers.dev/flatbuffers_guide_use_rust.html.

here is a link to my repository: https://github.com/toumorokoshi/profiling-sandbox/tree/main/src.

I used flatc 23.5.6.

toumorokoshi commented 5 months ago

Actually looking at the source code in this repo and the example, I see I shoudl be using flatbuffers::root now: https://github.com/google/flatbuffers/blob/master/samples/sample_binary.rs.

Does the documentation need to be updated? I could send a PR.