diff options
Diffstat (limited to 'rust/src/types.rs')
| -rw-r--r-- | rust/src/types.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs index 54c25234..534b7708 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -1563,6 +1563,14 @@ impl StructureBuilder { unsafe { BNRemoveStructureBuilderMember(self.handle, index) }; self } + + // TODO: We should add BNGetStructureBuilderAlignedWidth + /// Gets the current **unaligned** width of the structure. + /// + /// This cannot be used to accurately get the width of a non-packed structure. + pub fn current_width(&self) -> u64 { + unsafe { BNGetStructureBuilderWidth(self.handle) } + } } impl From<&Structure> for StructureBuilder { |
