Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
e5b6125f
Commit
e5b6125f
authored
Apr 27, 2019
by
jean-airoldie
Committed by
Robert
Apr 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added common rust traits to FlatBufferBuilder (#5307)
* Added Clone, Debug and Default
parent
ac14c890
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
builder.rs
rust/flatbuffers/src/builder.rs
+7
-0
No files found.
rust/flatbuffers/src/builder.rs
View file @
e5b6125f
...
...
@@ -40,6 +40,7 @@ struct FieldLoc {
/// FlatBufferBuilder builds a FlatBuffer through manipulating its internal
/// state. It has an owned `Vec<u8>` that grows as needed (up to the hardcoded
/// limit of 2GiB, which is set by the FlatBuffers format).
#[derive(Clone,
Debug)]
pub
struct
FlatBufferBuilder
<
'fbb
>
{
owned_buf
:
Vec
<
u8
>
,
head
:
usize
,
...
...
@@ -638,3 +639,9 @@ fn padding_bytes(buf_size: usize, scalar_size: usize) -> usize {
// ((!buf_size) + 1) & (scalar_size - 1)
(
!
buf_size
)
.wrapping_add
(
1
)
&
(
scalar_size
.wrapping_sub
(
1
))
}
impl
<
'fbb
>
Default
for
FlatBufferBuilder
<
'fbb
>
{
fn
default
()
->
Self
{
Self
::
new_with_capacity
(
0
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment