Skip to content

Commit

Permalink
Add StructureBuilder::current_width
Browse files Browse the repository at this point in the history
This was removed as the usage was problematic to say the least, adding it back with a warning
  • Loading branch information
emesare committed Jan 27, 2025
1 parent 1541ac1 commit 123bb13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rust/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 123bb13

Please sign in to comment.