We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac14c89 commit e5b6125Copy full SHA for e5b6125
rust/flatbuffers/src/builder.rs
@@ -40,6 +40,7 @@ struct FieldLoc {
40
/// FlatBufferBuilder builds a FlatBuffer through manipulating its internal
41
/// state. It has an owned `Vec<u8>` that grows as needed (up to the hardcoded
42
/// limit of 2GiB, which is set by the FlatBuffers format).
43
+#[derive(Clone, Debug)]
44
pub struct FlatBufferBuilder<'fbb> {
45
owned_buf: Vec<u8>,
46
head: usize,
@@ -638,3 +639,9 @@ fn padding_bytes(buf_size: usize, scalar_size: usize) -> usize {
638
639
// ((!buf_size) + 1) & (scalar_size - 1)
640
(!buf_size).wrapping_add(1) & (scalar_size.wrapping_sub(1))
641
}
642
+
643
+impl<'fbb> Default for FlatBufferBuilder<'fbb> {
644
+ fn default() -> Self {
645
+ Self::new_with_capacity(0)
646
+ }
647
+}
0 commit comments