mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 23:33:57 +00:00
[Rust] Add the Allocator trait for the builder API (#8106)
* Add an Allocator trait for FlatBufferBuilder * Update rust generated code
This commit is contained in:
@@ -127,7 +127,7 @@ impl AnyT {
|
||||
Self::MyGameExample2Monster(_) => Any::MyGame_Example2_Monster,
|
||||
}
|
||||
}
|
||||
pub fn pack(&self, fbb: &mut flatbuffers::FlatBufferBuilder) -> Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>> {
|
||||
pub fn pack<'b, A: flatbuffers::Allocator + 'b>(&self, fbb: &mut flatbuffers::FlatBufferBuilder<'b, A>) -> Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>> {
|
||||
match self {
|
||||
Self::NONE => None,
|
||||
Self::Monster(v) => Some(v.pack(fbb).as_union_value()),
|
||||
|
||||
Reference in New Issue
Block a user