summaryrefslogtreecommitdiff
path: root/rust/src/types.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-01-27 12:09:50 -0500
committerMason Reed <mason@vector35.com>2025-01-27 12:09:50 -0500
commit123bb13826f68cbfa3158e2ebf30ca59a143afb1 (patch)
treef74c628bba8cff79174fedc65ad426e4642cf52b /rust/src/types.rs
parent1541ac179ae9ae5b2ee4918f08cd301ec96f6cfe (diff)
Add `StructureBuilder::current_width`
This was removed as the usage was problematic to say the least, adding it back with a warning
Diffstat (limited to 'rust/src/types.rs')
-rw-r--r--rust/src/types.rs8
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 {