Skip to content

Commit 123bb13

Browse files
committed
Add StructureBuilder::current_width
This was removed as the usage was problematic to say the least, adding it back with a warning
1 parent 1541ac1 commit 123bb13

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rust/src/types.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,6 +1563,14 @@ impl StructureBuilder {
15631563
unsafe { BNRemoveStructureBuilderMember(self.handle, index) };
15641564
self
15651565
}
1566+
1567+
// TODO: We should add BNGetStructureBuilderAlignedWidth
1568+
/// Gets the current **unaligned** width of the structure.
1569+
///
1570+
/// This cannot be used to accurately get the width of a non-packed structure.
1571+
pub fn current_width(&self) -> u64 {
1572+
unsafe { BNGetStructureBuilderWidth(self.handle) }
1573+
}
15661574
}
15671575

15681576
impl From<&Structure> for StructureBuilder {

0 commit comments

Comments
 (0)